@stlite/desktop 0.91.2 → 0.92.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/README.md +10 -0
- package/build/assets/{ErrorOutline.esm-CBPRrcCq-C9-TIHiy.js → ErrorOutline.esm-B7r5abii-8TGLClC0.js} +1 -1
- package/build/assets/{FileDownload.esm-zztsCQgv-C5piFaVt.js → FileDownload.esm-CYy3w3Vv-BwlEuFJu.js} +1 -1
- package/build/assets/{FileHelper-D9iak492-B1kwMP-N.js → FileHelper-8inOMdj8-8VXLhO12.js} +1 -1
- package/build/assets/{FormClearHelper-B-0AN2KG-drNJ-Zdq.js → FormClearHelper-DcUb9gFm-uvoV81fq.js} +1 -1
- package/build/assets/{Hooks-BLb3umpI-CC08A2wx.js → Hooks-BLb3umpI-BjA4i06_.js} +1 -1
- package/build/assets/{InputInstructions-w5hPdqFC-DnPj3I4S.js → InputInstructions-CWrzjlV--n3Hf1PP9.js} +1 -1
- package/build/assets/{Particles-DQoPZNo9-BWmBxXhd.js → Particles-DtETFR7S-2aUDxKFJ.js} +1 -1
- package/build/assets/{ProgressBar-DlHaaa-z-DdC3oXz0.js → ProgressBar-Q8F-JGwo-LczZQzat.js} +1 -1
- package/build/assets/{Toolbar-Cau3SOTY-cJ6wtM04.js → Toolbar-Dj6ALImb-BVamUnHI.js} +1 -1
- package/build/assets/{base-input-D-Fvddky-3QuAUeGB.js → base-input-GLmTpqXt-CImyaDRq.js} +1 -1
- package/build/assets/{checkbox-CjcIG3na-LB8a9-d7.js → checkbox-CEGFZTJa-C72AFGdh.js} +1 -1
- package/build/assets/{createSuper-B81LEHTk-DVB4ulOX.js → createSuper-DBoQFSgk-BYJ7jbld.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-C7-8Z8CC-CmhK1L1G.js → data-grid-overlay-editor-KB2z8mJP-C62BT9jT.js} +1 -1
- package/build/assets/{downloader-DcCTL3Wz-DfHnsO-D.js → downloader-DcCTL3Wz-DCpITTU1.js} +1 -1
- package/build/assets/{es6--XPcqeHG-CU-P5RWV.js → es6--XPcqeHG-DhJ5N6cn.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-vAQsQkcx-DjDgPkx5.js → iframeResizer.contentWindow-B8PMRo_J-DvNzNbbR.js} +1 -1
- package/build/assets/{index-6t9Tq-Ab-Cc_ees8I.js → index-B4C0HP4d-BkRIYQ6B.js} +1 -1
- package/build/assets/{index-DEKI5kx7-B8lK1On8.js → index-B8DruXv7-BsVgHQy8.js} +1 -1
- package/build/assets/{index-D6OV4wQy-CQIpYALu.js → index-BEhJ1GQx-Bd2m54CP.js} +1 -1
- package/build/assets/{index-Da8BucgM-CDMzLZMq.js → index-BIgXGMHt-JW2hwTbx.js} +1 -1
- package/build/assets/{index-BxpEVUJq.js → index-BIyIgwS4.js} +10 -10
- package/build/assets/{index-DVo6TdD5-Cigl7ucs.js → index-BOT4J8P2-nhENc6Pb.js} +1 -1
- package/build/assets/{index-Bx1YyC6x-bUWv5Yyf.js → index-BUQFjfFe-DhpyxZBa.js} +1 -1
- package/build/assets/{index-oFRA4JRK-kx0e_3zA.js → index-BcOX_8Yb-BQhvH4hh.js} +1 -1
- package/build/assets/{index-BNeCf0z6-eizg-dFz.js → index-BeQFPWOx-B1_VBork.js} +1 -1
- package/build/assets/{index-DqAvSOqr-BCGTFud5.js → index-BlHNutXS-Bf1cUsIS.js} +1 -1
- package/build/assets/{index-B5h0Xgw3-CNFqm9ip.js → index-Bn_Q7wro-BclOBnF3.js} +1 -1
- package/build/assets/{index-vdN_5NIh-CyyygayY.js → index-Bqaw3D2g-DJFA3vu1.js} +1 -1
- package/build/assets/{index-Ds3R2kL1-CFh_Kz3Y.js → index-BvmneqQT-C6pM51YE.js} +1 -1
- package/build/assets/{index-C5FPtYYS-BTTgdUI2.js → index-C43v7-zt-XSOlpSRO.js} +1 -1
- package/build/assets/{index--hiX6Uwv-DtKO9Hld.js → index-C5n_E3xJ-C9GlH5Bh.js} +1 -1
- package/build/assets/{index-COXlYbHo-B2m8urCs.js → index-C9MF7a8p-1U1wjf1z.js} +1 -1
- package/build/assets/{index-D4OS_mB9-BwMU_oxN.js → index-C9t9keZs-Cj8jGlNq.js} +1 -1
- package/build/assets/{index-JJq6JoHy-CX1Omp_x.js → index-CCBxT-Px-B32Uy-Qk.js} +1 -1
- package/build/assets/{index-D9xjkRNt-CFe8X0f3.js → index-CKhpdqU4-B-ULAgQ3.js} +1 -1
- package/build/assets/{index-Bt2pmgaJ-ymksNLCl.js → index-CRwtTJoc-DxkxT91b.js} +5 -5
- package/build/assets/{index-CUH8SI0g-CgCG3Tq7.js → index-CVVkGp8U-OXoobo4A.js} +1 -1
- package/build/assets/{index-BXbsmcnm-D0BJVs7R.js → index-CmxogrTC-CmhUjGHI.js} +1 -1
- package/build/assets/{index-PfjJDWy5-DkldmeJ8.js → index-DGEZt8XB-BPwUD6x9.js} +1 -1
- package/build/assets/{index-CeUKVR_x-6fYziq6X.js → index-DIlmdxHH-DZzaykGG.js} +1 -1
- package/build/assets/{index-CR_1rzEZ-DaqWZNME.js → index-DQkZMKcP-qmoywAyX.js} +1 -1
- package/build/assets/{index-D5GvvN8r-CL05rAIV.js → index-DXzYmrGv-DMgQyWr1.js} +1 -1
- package/build/assets/{index-FbSORAjW-Lthz52ML.js → index-DpJLAqiz-BkX4MLEb.js} +1 -1
- package/build/assets/{index-D8AcUh2z-BvmWAicd.js → index-Dws1I0Ds-DN2TZwAq.js} +1 -1
- package/build/assets/{index-BDD6ManL-XC9-hEWd.js → index-E8OLJqjb-DnzI_NxU.js} +1 -1
- package/build/assets/{index-kgY8PEpO-BUILDAe7.js → index-EY_iYK3N-Bp22waFF.js} +1 -1
- package/build/assets/{index-BDtR3I-m-C6v_enzF.js → index-MLOYywLc-D7-SprmM.js} +1 -1
- package/build/assets/{index-DbIPIRRU-UJS7GIgX.js → index-gFid1htU-BDjIBtvA.js} +1 -1
- package/build/assets/{index-D9Ww6wIM-CODTYNKi.js → index-h6RjFy4Y-C5de9ASo.js} +1 -1
- package/build/assets/{index-CL9VPrGG-DvzaBWYj.js → index-hQQyMr9F-eQNYPxka.js} +1 -1
- package/build/assets/{index-DYssp6us-ss1M0SKX.js → index-kEUlOODQ-D3h_Flo2.js} +1 -1
- package/build/assets/{index-OAJkEMe--vGYqEFkN.js → index-nCXiKSAh-DSiervQu.js} +1 -1
- package/build/assets/{index-DBM8Q3zu-1UaS0Le1.js → index-oX5euHW0-C-SIRbDl.js} +1 -1
- package/build/assets/{inherits-DIXnBNlu-DQhXiByk.js → inherits-BwU0tCO4-DkeIG_qH.js} +1 -1
- package/build/assets/{input-D3V-zfyu-Ca751_uU.js → input-DMrd22sk-UYShFfZu.js} +1 -1
- package/build/assets/{memory-B3L1Fctl-DNb7NEQl.js → memory-B3L1Fctl-WytsaLFU.js} +1 -1
- package/build/assets/{number-overlay-editor-ChRMsdOl-C6ThLwiC.js → number-overlay-editor-CdbzA3D_-BCwwbhhn.js} +1 -1
- package/build/assets/{sandbox-ChAzL-i--FikCfyDW.js → sandbox-ChAzL-i--CpDb1da2.js} +1 -1
- package/build/assets/{slicedToArray-BPQXLGHq-C21Y2TxO.js → slicedToArray-CQ1aOJ-Q-fFO-C-TS.js} +1 -1
- package/build/assets/{timepicker-B0aGGgzd-sxFvpbfo.js → timepicker-DZap2iV8-CkcqVZT5.js} +1 -1
- package/build/assets/{uniqueId-MHj2wT7u-DPxsodx6.js → uniqueId-Dmqdy5md-DdrLw8YB.js} +1 -1
- package/build/assets/{useBasicWidgetState-zjZCXhqV-BNiFnFun.js → useBasicWidgetState-DH5OpqC3-H5wMmJFo.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-ox95UJrD-CZJQOtsK.js → useTextInputAutoExpand-B5nEdsJC-DTKFLxU2.js} +1 -1
- package/build/assets/{useUpdateUiValue-Yj1mvLxf-DIZzUp3u.js → useUpdateUiValue-CzJ3I42c-D42S2lbA.js} +1 -1
- package/build/assets/{withFullScreenWrapper-Ca0mIjWH-ClODS1xe.js → withFullScreenWrapper-CsmVH3u1-BwamaUTy.js} +1 -1
- package/build/index.html +1 -1
- package/package.json +3 -3
- package/wheels/streamlit-1.50.0-cp313-none-any.whl +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aX as P,bP as u,bR as ce,bS as T,r as b,b9 as H,bQ as D,aY as w,bs as Q,bt as X,bm as te,bn as oe,bo as ne,bp as ie}from"./index-
|
|
1
|
+
import{aX as P,bP as u,bR as ce,bS as T,r as b,b9 as H,bQ as D,aY as w,bs as Q,bt as X,bm as te,bn as oe,bo as ne,bp as ie}from"./index-BIyIgwS4.js";var pe=["title","size","color","overrides"];function L(){return L=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},L.apply(this,arguments)}function de(e,r){if(e==null)return{};var t=fe(e,r),o,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}function fe(e,r){if(e==null)return{};var t={},o=Object.keys(e),n,i;for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&(t[n]=e[n]);return t}function be(e,r){return me(e)||he(e,r)||ge(e,r)||ye()}function ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ge(e,r){if(e){if(typeof e=="string")return Y(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Y(e,r)}}function Y(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function he(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],n=!0,i=!1,a,l;try{for(t=t.call(e);!(n=(a=t.next()).done)&&(o.push(a.value),!(r&&o.length===r));n=!0);}catch(s){i=!0,l=s}finally{try{!n&&t.return!=null&&t.return()}finally{if(i)throw l}}return o}}function me(e){if(Array.isArray(e))return e}function ve(e,r){var t=te(),o=be(t,2),n=o[1],i=e.title,a=i===void 0?"Hide":i,l=e.size,s=e.color,c=e.overrides,p=c===void 0?{}:c,y=de(e,pe),h=oe({component:n.icons&&n.icons.Hide?n.icons.Hide:null},p&&p.Svg?ne(p.Svg):{});return b.createElement(ie,L({viewBox:"0 0 20 20",ref:r,title:a,size:l,color:s,overrides:{Svg:h}},y),b.createElement("path",{d:"M12.81 4.36l-1.77 1.78a4 4 0 00-4.9 4.9l-2.76 2.75C2.06 12.79.96 11.49.2 10a11 11 0 0112.6-5.64zm3.8 1.85c1.33 1 2.43 2.3 3.2 3.79a11 11 0 01-12.62 5.64l1.77-1.78a4 4 0 004.9-4.9l2.76-2.75zm-.25-3.99l1.42 1.42L3.64 17.78l-1.42-1.42L16.36 2.22z"}))}const Oe=b.forwardRef(ve);var Ce=["title","size","color","overrides"];function A(){return A=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},A.apply(this,arguments)}function we(e,r){if(e==null)return{};var t=Fe(e,r),o,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}function Fe(e,r){if(e==null)return{};var t={},o=Object.keys(e),n,i;for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&(t[n]=e[n]);return t}function Se(e,r){return Pe(e)||Te(e,r)||xe(e,r)||ke()}function ke(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xe(e,r){if(e){if(typeof e=="string")return Z(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Z(e,r)}}function Z(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function Te(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],n=!0,i=!1,a,l;try{for(t=t.call(e);!(n=(a=t.next()).done)&&(o.push(a.value),!(r&&o.length===r));n=!0);}catch(s){i=!0,l=s}finally{try{!n&&t.return!=null&&t.return()}finally{if(i)throw l}}return o}}function Pe(e){if(Array.isArray(e))return e}function je(e,r){var t=te(),o=Se(t,2),n=o[1],i=e.title,a=i===void 0?"Show":i,l=e.size,s=e.color,c=e.overrides,p=c===void 0?{}:c,y=we(e,Ce),h=oe({component:n.icons&&n.icons.Show?n.icons.Show:null},p&&p.Svg?ne(p.Svg):{});return b.createElement(ie,A({viewBox:"0 0 20 20",ref:r,title:a,size:l,color:s,overrides:{Svg:h}},y),b.createElement("path",{d:"M.2 10a11 11 0 0119.6 0A11 11 0 01.2 10zm9.8 4a4 4 0 100-8 4 4 0 000 8zm0-2a2 2 0 110-4 2 2 0 010 4z"}))}const Re=b.forwardRef(je);function J(e,r){var t=e.disabled,o=e.error,n=e.positive,i=e.adjoined,a=e.size,l=e.required,s=e.resize,c=e.readOnly,p=r.isFocused;return{$isFocused:p,$disabled:t,$error:o,$positive:n,$adjoined:i,$size:a,$required:l,$resize:s,$isReadOnly:c}}function G(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function g(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?G(Object(t),!0).forEach(function(o){d(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):G(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function d(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var K=P("button",function(e){var r,t=e.$theme,o=e.$size,n=e.$isFocusVisible,i=(r={},d(r,u.mini,t.sizing.scale400),d(r,u.compact,t.sizing.scale400),d(r,u.default,t.sizing.scale300),d(r,u.large,t.sizing.scale200),r)[o];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:i,paddingRight:i,outline:n?"solid 3px ".concat(t.colors.accent):"none",color:t.colors.contentPrimary}});K.displayName="StyledMaskToggleButton";K.displayName="StyledMaskToggleButton";var _=P("div",function(e){var r,t=e.$alignTop,o=t===void 0?!1:t,n=e.$size,i=e.$theme,a=(r={},d(r,u.mini,i.sizing.scale200),d(r,u.compact,i.sizing.scale200),d(r,u.default,i.sizing.scale100),d(r,u.large,i.sizing.scale0),r)[n];return{display:"flex",alignItems:o?"flex-start":"center",paddingLeft:a,paddingRight:a,paddingTop:o?i.sizing.scale500:"0px",color:i.colors.contentPrimary}});_.displayName="StyledClearIconContainer";_.displayName="StyledClearIconContainer";var W=P(ce,function(e){var r=e.$theme,t=e.$isFocusVisible;return{cursor:"pointer",outline:t?"solid 3px ".concat(r.colors.accent):"none"}});W.displayName="StyledClearIcon";W.displayName="StyledClearIcon";function $e(e,r){var t;return(t={},d(t,u.mini,{paddingTop:r.scale100,paddingBottom:r.scale100,paddingLeft:r.scale550,paddingRight:r.scale550}),d(t,u.compact,{paddingTop:r.scale200,paddingBottom:r.scale200,paddingLeft:r.scale550,paddingRight:r.scale550}),d(t,u.default,{paddingTop:r.scale400,paddingBottom:r.scale400,paddingLeft:r.scale550,paddingRight:r.scale550}),d(t,u.large,{paddingTop:r.scale550,paddingBottom:r.scale550,paddingLeft:r.scale550,paddingRight:r.scale550}),t)[e]}function Be(e,r,t,o,n){var i=e===T.both||e===T.left&&o!=="rtl"||e===T.right&&o==="rtl"||n&&o==="rtl",a=e===T.both||e===T.right&&o!=="rtl"||e===T.left&&o==="rtl"||n&&o!=="rtl";return{paddingLeft:i?t.scale550:"0px",paddingRight:a?t.scale550:"0px"}}function z(e,r){var t;return(t={},d(t,u.mini,r.font100),d(t,u.compact,r.font200),d(t,u.default,r.font300),d(t,u.large,r.font400),t)[e]}function Ee(e,r,t){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,n=arguments.length>4?arguments[4]:void 0;return e?{borderLeftColor:n.inputFillDisabled,borderRightColor:n.inputFillDisabled,borderTopColor:n.inputFillDisabled,borderBottomColor:n.inputFillDisabled,backgroundColor:n.inputFillDisabled}:r?{borderLeftColor:n.borderSelected,borderRightColor:n.borderSelected,borderTopColor:n.borderSelected,borderBottomColor:n.borderSelected,backgroundColor:n.inputFillActive}:t?{borderLeftColor:n.inputBorderError,borderRightColor:n.inputBorderError,borderTopColor:n.inputBorderError,borderBottomColor:n.inputBorderError,backgroundColor:n.inputFillError}:o?{borderLeftColor:n.inputBorderPositive,borderRightColor:n.inputBorderPositive,borderTopColor:n.inputBorderPositive,borderBottomColor:n.inputBorderPositive,backgroundColor:n.inputFillPositive}:{borderLeftColor:n.inputBorder,borderRightColor:n.inputBorder,borderTopColor:n.inputBorder,borderBottomColor:n.inputBorder,backgroundColor:n.inputFill}}function Ie(e,r){var t=r.inputBorderRadius;return e===u.mini&&(t=r.inputBorderRadiusMini),{borderTopLeftRadius:t,borderBottomLeftRadius:t,borderTopRightRadius:t,borderBottomRightRadius:t}}var ze=function(e){var r=e.$isFocused,t=e.$adjoined,o=e.$error,n=e.$disabled,i=e.$positive,a=e.$size,l=e.$theme,s=e.$theme,c=s.borders,p=s.colors,y=s.sizing,h=s.typography,O=s.animation,S=e.$hasIconTrailing;return g(g(g(g({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:O.timing200,transitionTimingFunction:O.easeOutCurve},Ie(a,c)),z(a,h)),Ee(n,r,o,i,p)),Be(t,a,y,l.direction,S))},ae=P("div",ze);ae.displayName="Root";ae.displayName="Root";function Me(e,r){var t;return(t={},d(t,u.mini,{paddingRight:r.scale400,paddingLeft:r.scale400}),d(t,u.compact,{paddingRight:r.scale400,paddingLeft:r.scale400}),d(t,u.default,{paddingRight:r.scale300,paddingLeft:r.scale300}),d(t,u.large,{paddingRight:r.scale200,paddingLeft:r.scale200}),t)[e]}function De(e,r,t,o,n){return e?{color:n.inputEnhancerTextDisabled,backgroundColor:n.inputFillDisabled}:r?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:t?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}var le=P("div",function(e){var r=e.$size,t=e.$disabled,o=e.$isFocused,n=e.$error,i=e.$positive,a=e.$theme,l=a.colors,s=a.sizing,c=a.typography,p=a.animation;return g(g(g({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:p.timing200,transitionTimingFunction:p.easeOutCurve},z(r,c)),Me(r,s)),De(t,o,n,i,l))});le.displayName="InputEnhancer";le.displayName="InputEnhancer";function Le(e,r,t,o,n){return e?{color:n.inputTextDisabled,backgroundColor:n.inputFillDisabled}:r?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:t?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}var Ae=function(e){var r=e.$isFocused,t=e.$error,o=e.$disabled,n=e.$positive,i=e.$size,a=e.$theme,l=a.colors,s=a.typography,c=a.animation;return g(g({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:c.timing200,transitionTimingFunction:c.easeOutCurve},z(i,s)),Le(o,r,t,n,l))},U=P("div",Ae);U.displayName="InputContainer";U.displayName="InputContainer";function Ve(e,r,t,o){return e?{color:o.inputTextDisabled,"-webkit-text-fill-color":o.inputTextDisabled,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholderDisabled}}:{color:o.contentPrimary,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholder}}}var Ne=function(e){var r=e.$disabled,t=e.$isFocused,o=e.$error,n=e.$size,i=e.$theme,a=i.colors,l=i.sizing,s=i.typography;return g(g(g({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:r?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},z(n,s)),$e(n,l)),Ve(r,t,o,a))},q=P("input",Ne);q.displayName="Input";q.displayName="Input";function Ke(e){var r;return typeof window.Event=="function"?r=new window.Event(e,{bubbles:!0,cancelable:!0}):(r=document.createEvent("Event"),r.initEvent(e,!0,!0)),r}function V(e){"@babel/helpers - typeof";return V=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},V(e)}function v(){return v=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},v.apply(this,arguments)}function F(e,r){return qe(e)||Ue(e,r)||We(e,r)||_e()}function _e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function We(e,r){if(e){if(typeof e=="string")return ee(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ee(e,r)}}function ee(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function Ue(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],n=!0,i=!1,a,l;try{for(t=t.call(e);!(n=(a=t.next()).done)&&(o.push(a.value),!(r&&o.length===r));n=!0);}catch(s){i=!0,l=s}finally{try{!n&&t.return!=null&&t.return()}finally{if(i)throw l}}return o}}function qe(e){if(Array.isArray(e))return e}function He(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Qe(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Xe(e,r,t){return r&&Qe(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ye(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&N(e,r)}function N(e,r){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},N(e,r)}function Ze(e){var r=Ge();return function(){var t=I(e),o;if(r){var n=I(this).constructor;o=Reflect.construct(t,arguments,n)}else o=t.apply(this,arguments);return Je(this,o)}}function Je(e,r){if(r&&(V(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function m(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ge(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I(e)}function f(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var re=function(){return null},er=(function(e){Ye(t,e);var r=Ze(t);function t(){var o;He(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return o=r.call.apply(r,[this].concat(i)),f(m(o),"inputRef",o.props.inputRef||b.createRef()),f(m(o),"state",{isFocused:o.props.autoFocus||!1,isMasked:o.props.type==="password",initialType:o.props.type,isFocusVisibleForClear:!1,isFocusVisibleForMaskToggle:!1}),f(m(o),"onInputKeyDown",function(l){o.props.clearOnEscape&&l.key==="Escape"&&o.inputRef.current&&!o.props.readOnly&&(o.clearValue(),l.stopPropagation())}),f(m(o),"onClearIconClick",function(){o.inputRef.current&&o.clearValue(),o.inputRef.current&&o.inputRef.current.focus()}),f(m(o),"onFocus",function(l){o.setState({isFocused:!0}),o.props.onFocus(l)}),f(m(o),"onBlur",function(l){o.setState({isFocused:!1}),o.props.onBlur(l)}),f(m(o),"handleFocusForMaskToggle",function(l){H(l)&&o.setState({isFocusVisibleForMaskToggle:!0})}),f(m(o),"handleBlurForMaskToggle",function(l){o.state.isFocusVisibleForMaskToggle!==!1&&o.setState({isFocusVisibleForMaskToggle:!1})}),f(m(o),"handleFocusForClear",function(l){H(l)&&o.setState({isFocusVisibleForClear:!0})}),f(m(o),"handleBlurForClear",function(l){o.state.isFocusVisibleForClear!==!1&&o.setState({isFocusVisibleForClear:!1})}),o}return Xe(t,[{key:"componentDidMount",value:function(){var o=this.props,n=o.autoFocus,i=o.clearable;this.inputRef.current&&(n&&this.inputRef.current.focus(),i&&this.inputRef.current.addEventListener("keydown",this.onInputKeyDown))}},{key:"componentWillUnmount",value:function(){var o=this.props.clearable;o&&this.inputRef.current&&this.inputRef.current.removeEventListener("keydown",this.onInputKeyDown)}},{key:"clearValue",value:function(){var o=this.inputRef.current;if(o){var n=Object.getOwnPropertyDescriptor(this.props.type===D.textarea?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,"value");if(n){var i=n.set;if(i){i.call(o,"");var a=Ke("input");o.dispatchEvent(a)}}}}},{key:"getInputType",value:function(){return this.props.type==="password"?this.state.isMasked?"password":"text":this.props.type}},{key:"renderMaskToggle",value:function(){var o,n=this;if(this.props.type!=="password")return null;var i=w(this.props.overrides.MaskToggleButton,K),a=F(i,2),l=a[0],s=a[1],c=w(this.props.overrides.MaskToggleShowIcon,Re),p=F(c,2),y=p[0],h=p[1],O=w(this.props.overrides.MaskToggleHideIcon,Oe),S=F(O,2),j=S[0],$=S[1],C=this.state.isMasked?"Show password text":"Hide password text",R=(o={},f(o,u.mini,"12px"),f(o,u.compact,"16px"),f(o,u.default,"20px"),f(o,u.large,"24px"),o)[this.props.size];return b.createElement(l,v({$size:this.props.size,$isFocusVisible:this.state.isFocusVisibleForMaskToggle,"aria-label":C,onClick:function(){return n.setState(function(k){return{isMasked:!k.isMasked}})},title:C,type:"button"},s,{onFocus:X(s,this.handleFocusForMaskToggle),onBlur:Q(s,this.handleBlurForMaskToggle)}),this.state.isMasked?b.createElement(y,v({size:R,title:C},h)):b.createElement(j,v({size:R,title:C},$)))}},{key:"renderClear",value:function(){var o,n=this,i=this.props,a=i.clearable,l=i.value,s=i.disabled,c=i.readOnly,p=i.overrides,y=p===void 0?{}:p;if(s||c||!a||l==null||typeof l=="string"&&l.length===0)return null;var h=w(y.ClearIconContainer,_),O=F(h,2),S=O[0],j=O[1],$=w(y.ClearIcon,W),C=F($,2),R=C[0],k=C[1],B="Clear value",E=J(this.props,this.state),M=(o={},f(o,u.mini,"14px"),f(o,u.compact,"14px"),f(o,u.default,"16px"),f(o,u.large,"22px"),o)[this.props.size];return b.createElement(S,v({$alignTop:this.props.type===D.textarea},E,j),b.createElement(R,v({size:M,tabIndex:0,title:B,"aria-label":B,onClick:this.onClearIconClick,onKeyDown:function(x){x.key&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),n.onClearIconClick())},role:"button",$isFocusVisible:this.state.isFocusVisibleForClear},E,k,{onFocus:X(k,this.handleFocusForClear),onBlur:Q(k,this.handleBlurForClear)})))}},{key:"render",value:function(){var o=this.props.overrides,n=o.InputContainer,i=o.Input,a=o.Before,l=o.After,s=this.state.initialType==="password"&&this.props.autoComplete===t.defaultProps.autoComplete?"new-password":this.props.autoComplete,c=J(this.props,this.state),p=w(n,U),y=F(p,2),h=y[0],O=y[1],S=w(i,q),j=F(S,2),$=j[0],C=j[1],R=w(a,re),k=F(R,2),B=k[0],E=k[1],M=w(l,re),x=F(M,2),se=x[0],ue=x[1];return b.createElement(h,v({"data-baseweb":this.props["data-baseweb"]||"base-input"},c,O),b.createElement(B,v({},c,E)),b.createElement($,v({ref:this.inputRef,"aria-activedescendant":this.props["aria-activedescendant"],"aria-autocomplete":this.props["aria-autocomplete"],"aria-controls":this.props["aria-controls"],"aria-errormessage":this.props["aria-errormessage"],"aria-haspopup":this.props["aria-haspopup"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-invalid":this.props.error,"aria-required":this.props.required,autoComplete:s,disabled:this.props.disabled,readOnly:this.props.readOnly,id:this.props.id,inputMode:this.props.inputMode,maxLength:this.props.maxLength,name:this.props.name,onBlur:this.onBlur,onChange:this.props.onChange,onFocus:this.onFocus,onKeyDown:this.props.onKeyDown,onKeyPress:this.props.onKeyPress,onKeyUp:this.props.onKeyUp,pattern:this.props.pattern,placeholder:this.props.placeholder,type:this.getInputType(),required:this.props.required,role:this.props.role,value:this.props.value,min:this.props.min,max:this.props.max,step:this.props.step,rows:this.props.type===D.textarea?this.props.rows:null},c,C)),this.renderClear(),this.renderMaskToggle(),b.createElement(se,v({},c,ue)))}}]),t})(b.Component);f(er,"defaultProps",{"aria-activedescendant":null,"aria-autocomplete":null,"aria-controls":null,"aria-errormessage":null,"aria-haspopup":null,"aria-label":null,"aria-labelledby":null,"aria-describedby":null,adjoined:T.none,autoComplete:"on",autoFocus:!1,disabled:!1,error:!1,positive:!1,name:"",inputMode:"text",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},onClear:function(){},clearable:!1,clearOnEscape:!0,overrides:{},pattern:null,placeholder:"",required:!1,role:null,size:u.default,type:"text",readOnly:!1});export{ze as A,Ae as D,Ne as V,J as e,q,ae as s,er as t,le as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aX as v,b9 as oe,ba as h,r as c,bb as m}from"./index-
|
|
1
|
+
import{aX as v,b9 as oe,ba as h,r as c,bb as m}from"./index-BIyIgwS4.js";var S=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),ve=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"});function _(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),o.push.apply(o,t)}return o}function x(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?_(Object(o),!0).forEach(function(t){U(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):_(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function U(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function ie(e){var r=e.$disabled,o=e.$checked,t=e.$error,s=e.$isIndeterminate,i=e.$theme,n=e.$isFocusVisible,a=i.colors;return r?a.tickFillDisabled:o||s?"transparent":t?a.borderNegative:n?a.borderSelected:a.tickBorder}function ne(e){var r=e.$labelPlacement,o=r===void 0?"":r,t=e.$theme,s=t.sizing,i=s.scale300,n;switch(o){case"top":n="Bottom";break;case"bottom":n="Top";break;case"left":n="Right";break;default:case"right":n="Left";break}return t.direction==="rtl"&&n==="Left"?n="Right":t.direction==="rtl"&&n==="Right"&&(n="Left"),U({},"padding".concat(n),i)}function ae(e){var r=e.$disabled,o=e.$checked,t=e.$isIndeterminate,s=e.$error,i=e.$isHovered,n=e.$isActive,a=e.$theme,l=a.colors;return r?o||t?l.tickFillDisabled:l.tickFill:s&&(t||o)?n?l.tickFillErrorSelectedHoverActive:i?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:s?n?l.tickFillErrorHoverActive:i?l.tickFillErrorHover:l.tickFillError:t||o?n?l.tickFillSelectedHoverActive:i?l.tickFillSelectedHover:l.tickFillSelected:n?l.tickFillActive:i?l.tickFillHover:l.tickFill}function le(e){var r=e.$disabled,o=e.$theme,t=o.colors;return r?t.contentSecondary:t.contentPrimary}var L=v("label",function(e){var r=e.$disabled,o=e.$labelPlacement;return{flexDirection:o==="top"||o==="bottom"?"column":"row",display:"flex",alignItems:o==="top"||o==="bottom"?"center":"flex-start",cursor:r?"not-allowed":"pointer",userSelect:"none"}});L.displayName="Root";L.displayName="Root";var T=v("span",function(e){var r=e.$checked,o=e.$disabled,t=e.$error,s=e.$isIndeterminate,i=e.$theme,n=e.$isFocusVisible,a=i.sizing,l=i.animation,y=o?i.colors.tickMarkFillDisabled:t?i.colors.tickMarkFillError:i.colors.tickMarkFill,k=encodeURIComponent(`
|
|
2
2
|
<svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<path d="M14 0.5H0V3.5H14V0.5Z" fill="`.concat(y,`"/>
|
|
4
4
|
</svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,y as a}from"./inherits-
|
|
1
|
+
import{a as o,y as a}from"./inherits-BwU0tCO4-DkeIG_qH.js";function e(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(e=function(){return!!t})()}function f(t){var c=e();return function(){var r,n=o(t);if(c){var u=o(this).constructor;r=Reflect.construct(n,arguments,u)}else r=n.apply(this,arguments);return a(this,r)}}export{f as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,b as J}from"./index-
|
|
1
|
+
import{r,b as J}from"./index-BIyIgwS4.js";import{B as R,F as Q,a as U,H as Z,z as ee,s as te,h as re}from"./index-CRwtTJoc-DxkxT91b.js";import"./withFullScreenWrapper-CsmVH3u1-BwamaUTy.js";import"./Toolbar-Dj6ALImb-BVamUnHI.js";import"./FormClearHelper-DcUb9gFm-uvoV81fq.js";import"./sprintf-D5E86llw-6tzWM3a-.js";import"./checkbox-CEGFZTJa-C72AFGdh.js";import"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import"./slicedToArray-CQ1aOJ-Q-fFO-C-TS.js";import"./inherits-BwU0tCO4-DkeIG_qH.js";import"./createSuper-DBoQFSgk-BYJ7jbld.js";import"./FileDownload.esm-CYy3w3Vv-BwlEuFJu.js";const ie=()=>t=>t.targetX,ae=()=>t=>t.targetY,oe=()=>t=>t.targetWidth,ne=()=>t=>t.targetHeight,se=()=>t=>t.targetY+10,le=()=>t=>Math.max(0,(t.targetHeight-28)/2),de=re("div")({name:"DataGridOverlayEditorStyle",class:"gdg-d19meir1",propsAsIs:!1,vars:{"d19meir1-0":[ae(),"px"],"d19meir1-1":[ie(),"px"],"d19meir1-2":[oe(),"px"],"d19meir1-3":[ne(),"px"],"d19meir1-4":[se(),"px"],"d19meir1-5":[le(),"px"]}});function ce(){const[t,o]=r.useState();return[t??void 0,o]}function ue(){const[t,o]=ce(),[a,f]=r.useState(0),[m,b]=r.useState(!0);r.useLayoutEffect(()=>{if(t===void 0||!("IntersectionObserver"in window))return;const n=new IntersectionObserver(s=>{s.length!==0&&b(s[0].isIntersecting)},{threshold:1});return n.observe(t),()=>n.disconnect()},[t]),r.useEffect(()=>{if(m||t===void 0)return;let n;const s=()=>{const{right:k}=t.getBoundingClientRect();f(g=>Math.min(g+window.innerWidth-k-10,0)),n=requestAnimationFrame(s)};return n=requestAnimationFrame(s),()=>{n!==void 0&&cancelAnimationFrame(n)}},[t,m]);const C=r.useMemo(()=>({transform:`translateX(${a}px)`}),[a]);return{ref:o,style:C}}const we=t=>{const{target:o,content:a,onFinishEditing:f,forceEditMode:m,initialValue:b,imageEditorOverride:C,markdownDivCreateNode:n,highlight:s,className:k,theme:g,id:V,cell:p,bloom:S,portalElementRef:F,validateCell:v,getCellRenderer:P,provideEditor:H,isOutsideClick:W,customEventTarget:X,activation:x}=t,[l,Y]=r.useState(m?a:void 0),w=r.useRef(l??a);w.current=l??a;const[h,M]=r.useState(()=>v===void 0?!0:!(R(a)&&v?.(p,a,w.current)===!1)),c=r.useCallback((e,i)=>{f(h?e:void 0,i)},[h,f]),q=r.useCallback(e=>{if(v!==void 0&&e!==void 0&&R(e)){const i=v(p,e,w.current);i===!1?M(!1):(typeof i=="object"&&(e=i),M(!0))}Y(e)},[p,v]),E=r.useRef(!1),u=r.useRef(void 0),z=r.useCallback(()=>{c(l,[0,0]),E.current=!0},[l,c]),G=r.useCallback((e,i)=>{c(e,i??u.current??[0,0]),E.current=!0},[c]),j=r.useCallback(async e=>{let i=!1;e.key==="Escape"?(e.stopPropagation(),e.preventDefault(),u.current=[0,0]):e.key==="Enter"&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),u.current=[0,1],i=!0):e.key==="Tab"&&(e.stopPropagation(),e.preventDefault(),u.current=[e.shiftKey?-1:1,0],i=!0),window.setTimeout(()=>{!E.current&&u.current!==void 0&&(c(i?l:void 0,u.current),E.current=!0)},0)},[c,l]),O=l??a,[d,L]=r.useMemo(()=>{if(Q(a))return[];const e={...a,location:p,activation:x},i=H?.(e);return i!==void 0?[i,!1]:[P(a)?.provideEditor?.(e),!1]},[p,a,P,H,x]),{ref:$,style:_}=ue();let N=!0,B,I=!0,y;if(d!==void 0){N=d.disablePadding!==!0,I=d.disableStyling!==!0;const e=U(d);e&&(y=d.styleOverride);const i=e?d.editor:d;B=r.createElement(i,{portalElementRef:F,isHighlighted:s,activation:x,onChange:q,value:O,initialValue:b,onFinishedEditing:G,validatedSelection:R(O)?O.selectionRange:void 0,forceEditMode:m,target:o,imageEditorOverride:C,markdownDivCreateNode:n,isValid:h,theme:g})}y={...y,..._};const A=F?.current??document.getElementById("portal");if(A===null)return console.error('Cannot open Data Grid overlay editor, because portal not found. Please, either provide a portalElementRef or add `<div id="portal" />` as the last child of your `<body>`.'),null;let D=I?"gdg-style":"gdg-unstyle";h||(D+=" gdg-invalid"),N&&(D+=" gdg-pad");const T=S?.[0]??1,K=S?.[1]??1;return J.createPortal(r.createElement(Z.Provider,{value:g},r.createElement(ee,{style:te(g),className:k,onClickOutside:z,isOutsideClick:W,customEventTarget:X},r.createElement(de,{ref:$,id:V,className:D,style:y,as:L===!0?"label":void 0,targetX:o.x-T,targetY:o.y-K,targetWidth:o.width+T*2,targetHeight:o.height+K*2},r.createElement("div",{className:"gdg-clip-region",onKeyDown:j},B)))),A)};export{we as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,e as b}from"./es6--XPcqeHG-
|
|
1
|
+
import{c as f,e as b}from"./es6--XPcqeHG-DhJ5N6cn.js";import"./index-BIyIgwS4.js";const{WritableStream:y,TransformStream:_,DOMException:P,Blob:m}=f,{GONE:v}=b,M=/constructor/i.test(window.HTMLElement);class A{constructor(e="unkown"){this.name=e,this.kind="file"}async getFile(){throw new P(...v)}async isSameEntry(e){return this===e}async createWritable(e={}){const t=await navigator.serviceWorker?.getRegistration(),a=document.createElement("a"),o=new _,u=o.writable;if(a.download=this.name,M||!t){let s=[];o.readable.pipeTo(new y({write(r){s.push(new m([r]))},close(){const r=new m(s,{type:"application/octet-stream; charset=utf-8"});s=[],a.href=URL.createObjectURL(r),a.click(),setTimeout(()=>URL.revokeObjectURL(a.href),1e4)}}))}else{const{writable:s,readablePort:r}=new O(y),n=encodeURIComponent(this.name).replace(/['()]/g,escape).replace(/\*/g,"%2A"),g={"content-disposition":"attachment; filename*=UTF-8''"+n,"content-type":"application/octet-stream; charset=utf-8",...e.size?{"content-length":e.size}:{}},w=setTimeout(()=>t.active.postMessage(0),1e4);o.readable.pipeThrough(new _({transform(c,h){if(c instanceof Uint8Array)return h.enqueue(c);const R=new Response(c).body.getReader(),d=S=>R.read().then(p=>p.done?0:d(h.enqueue(p.value)));return d()}})).pipeTo(s).finally(()=>{clearInterval(w)}),t.active.postMessage({url:t.scope+n,headers:g,readablePort:r},[r]);const i=document.createElement("iframe");i.hidden=!0,i.src=t.scope+n,document.body.appendChild(i)}return u.getWriter()}}const E=0,T=0,U=1,j=1,k=2;class L{constructor(e){e.onmessage=t=>this._onMessage(t.data),this._port=e,this._resetReady()}start(e){return this._controller=e,this._readyPromise}write(e){const t={type:E,chunk:e};return this._port.postMessage(t,[e.buffer]),this._resetReady(),this._readyPromise}close(){this._port.postMessage({type:k}),this._port.close()}abort(e){this._port.postMessage({type:j,reason:e}),this._port.close()}_onMessage(e){e.type===T&&this._resolveReady(),e.type===U&&this._onError(e.reason)}_onError(e){this._controller.error(e),this._rejectReady(e),this._port.close()}_resetReady(){this._readyPromise=new Promise((e,t)=>{this._readyResolve=e,this._readyReject=t}),this._readyPending=!0}_resolveReady(){this._readyResolve(),this._readyPending=!1}_rejectReady(e){this._readyPending||this._resetReady(),this._readyPromise.catch(()=>{}),this._readyReject(e),this._readyPending=!1}}class O{constructor(e){const t=new MessageChannel;this.readablePort=t.port1,this.writable=new e(new L(t.port2))}}export{A as FileHandle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/downloader-DcCTL3Wz-
|
|
2
|
-
import{c8 as b}from"./index-BxpEVUJq.js";const k=globalThis.showDirectoryPicker;async function j(i={}){if(k&&!i._preferPolyfill)return k(i);const e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0,e.style.position="fixed",e.style.top="-100000px",e.style.left="-100000px",document.body.appendChild(e);const t=Promise.resolve().then(()=>A);return await new Promise(r=>{e.addEventListener("change",r),e.click()}),t.then(r=>r.getDirHandlesFromInput(e))}const N={accepts:[]},x=globalThis.showOpenFilePicker;async function L(i={}){const e={...N,...i};if(x&&!i._preferPolyfill)return x(e);const t=document.createElement("input");t.type="file",t.multiple=e.multiple,t.accept=(e.accepts||[]).map(n=>[...(n.extensions||[]).map(s=>"."+s),...n.mimeTypes||[]]).flat().join(","),Object.assign(t.style,{position:"fixed",top:"-100000px",left:"-100000px"}),document.body.appendChild(t);const r=Promise.resolve().then(()=>A);return await new Promise(n=>{t.addEventListener("change",n,{once:!0}),t.click()}),t.remove(),r.then(n=>n.getFileHandlesFromInput(t))}const I=globalThis.showSaveFilePicker;async function W(i={}){if(I&&!i._preferPolyfill)return I(i);i._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),i.suggestedName=i._name);const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h),{FileHandle:t}=await b(async()=>{const{FileHandle:r}=await import("./downloader-DcCTL3Wz-DfHnsO-D.js");return{FileHandle:r}},__vite__mapDeps([0,1,2]));return new e(new t(i.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){const i=this.webkitGetAsEntry(),[{FileHandle:e,FolderHandle:t},{FileSystemDirectoryHandle:r},{FileSystemFileHandle:n}]=await Promise.all([b(()=>import("./sandbox-ChAzL-i--FikCfyDW.js"),__vite__mapDeps([3,1,2])),Promise.resolve().then(()=>_),Promise.resolve().then(()=>h)]);return i.isFile?new n(new e(i,!1)):new r(new t(i,!1))});async function R(i,e={}){if(!i)return globalThis.navigator?.storage?.getDirectory()||globalThis.getOriginPrivateDirectory();const{FileSystemDirectoryHandle:t}=await Promise.resolve().then(()=>_),r=await i,n=await(r.default?r.default(e):r(e));return new t(n)}const q={WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,DOMException:globalThis.DOMException,Blob:globalThis.Blob,File:globalThis.File},{WritableStream:z}=q;class m extends z{#e;constructor(e){super(e),this.#e=e,Object.setPrototypeOf(this,m.prototype),this._closed=!1}async close(){this._closed=!0;const e=this.getWriter(),t=e.close();return e.releaseLock(),t}seek(e){return this.write({type:"seek",position:e})}truncate(e){return this.write({type:"truncate",size:e})}write(e){if(this._closed)return Promise.reject(new TypeError("Cannot write to a CLOSED writable stream"));const t=this.getWriter(),r=t.write(e);return t.releaseLock(),r}}Object.defineProperty(m.prototype,Symbol.toStringTag,{value:"FileSystemWritableFileStream",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(m.prototype,{close:{enumerable:!0},seek:{enumerable:!0},truncate:{enumerable:!0},write:{enumerable:!0}});globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable&&!globalThis.FileSystemWritableFileStream&&(globalThis.FileSystemWritableFileStream=m);const y=Symbol("adapter");class T{[y];name;kind;constructor(e){this.kind=e.kind,this.name=e.name,this[y]=e}async queryPermission(e={}){const{mode:t="read"}=e,r=this[y];if(r.queryPermission)return r.queryPermission({mode:t});if(t==="read")return"granted";if(t==="readwrite")return r.writable?"granted":"denied";throw new TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async requestPermission({mode:e="read"}={}){const t=this[y];if(t.requestPermission)return t.requestPermission({mode:e});if(e==="read")return"granted";if(e==="readwrite")return t.writable?"granted":"denied";throw new TypeError(`Mode ${e} must be 'read' or 'readwrite'`)}async remove(e={}){await this[y].remove(e)}async isSameEntry(e){return this===e?!0:!e||typeof e!="object"||this.kind!==e.kind||!e[y]?!1:this[y].isSameEntry(e[y])}}Object.defineProperty(T.prototype,Symbol.toStringTag,{value:"FileSystemHandle",writable:!1,enumerable:!1,configurable:!0});globalThis.FileSystemHandle&&(globalThis.FileSystemHandle.prototype.queryPermission??=function(i){return"granted"});const O={INVALID:["seeking position failed.","InvalidStateError"],GONE:["A requested file or directory could not be found at the time an operation was processed.","NotFoundError"],MISMATCH:["The path supplied exists, but was not an entry of requested type.","TypeMismatchError"],MOD_ERR:["The object can not be modified in this way.","InvalidModificationError"],SYNTAX:i=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${i}`,"SyntaxError"],SECURITY:["It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.","SecurityError"],DISALLOWED:["The request is not allowed by the user agent or the platform in the current context.","NotAllowedError"]},U={writable:globalThis.WritableStream};async function V(i){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");const[e,t,r]=await Promise.all([b(()=>import("./memory-B3L1Fctl-DNb7NEQl.js"),__vite__mapDeps([4,1,2])),b(()=>import("./sandbox-ChAzL-i--FikCfyDW.js"),__vite__mapDeps([3,1,2])),Promise.resolve().then(()=>_)]),n=new e.FolderHandle("",!1);return n._entries=i.map(s=>s.isFile?new t.FileHandle(s,!1):new t.FolderHandle(s,!1)),new r.FileSystemDirectoryHandle(n)}async function B(i){const{FolderHandle:e,FileHandle:t}=await b(async()=>{const{FolderHandle:c,FileHandle:o}=await import("./memory-B3L1Fctl-DNb7NEQl.js");return{FolderHandle:c,FileHandle:o}},__vite__mapDeps([4,1,2])),{FileSystemDirectoryHandle:r}=await Promise.resolve().then(()=>_),n=Array.from(i.files),s=n[0].webkitRelativePath.split("/",1)[0],l=new e(s,!1);return n.forEach(c=>{const o=c.webkitRelativePath.split("/");o.shift();const d=o.pop(),p=o.reduce((f,w)=>(f._entries[w]||(f._entries[w]=new e(w,!1)),f._entries[w]),l);p._entries[d]=new t(c.name,c,!1)}),new r(l)}async function C(i){const{FileHandle:e}=await b(async()=>{const{FileHandle:r}=await import("./memory-B3L1Fctl-DNb7NEQl.js");return{FileHandle:r}},__vite__mapDeps([4,1,2])),{FileSystemFileHandle:t}=await Promise.resolve().then(()=>h);return Array.from(i.files).map(r=>new t(new e(r.name,r,!1)))}const A=Object.freeze(Object.defineProperty({__proto__:null,config:U,errors:O,fromDataTransfer:V,getDirHandlesFromInput:B,getFileHandlesFromInput:C},Symbol.toStringTag,{value:"Module"})),{GONE:G,MOD_ERR:$}=O,u=Symbol("adapter");let S=class H extends T{[u];constructor(e){super(e),this[u]=e}async getDirectoryHandle(e,t={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");t.create=!!t.create;const r=await this[u].getDirectoryHandle(e,t);return new H(r)}async*entries(){const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h);for await(const[t,r]of this[u].entries())yield[r.name,r.kind==="file"?new e(r):new H(r)]}async*getEntries(){const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h);console.warn("deprecated, use .entries() instead");for await(let t of this[u].entries())yield t.kind==="file"?new e(t):new H(t)}async getFileHandle(e,t={}){const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>h);if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");t.create=!!t.create;const n=await this[u].getFileHandle(e,t);return new r(n)}async removeEntry(e,t={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");return t.recursive=!!t.recursive,this[u].removeEntry(e,t)}async resolve(e){if(await e.isSameEntry(this))return[];const t=[{handle:this,path:[]}];for(;t.length;){let{handle:r,path:n}=t.pop();for await(const s of r.values()){if(await s.isSameEntry(e))return[...n,s.name];s.kind==="directory"&&t.push({handle:s,path:[...n,s.name]})}}return null}async*keys(){for await(const[e]of this[u].entries())yield e}async*values(){for await(const[e,t]of this)yield t}[Symbol.asyncIterator](){return this.entries()}};Object.defineProperty(S.prototype,Symbol.toStringTag,{value:"FileSystemDirectoryHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(S.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}});if(globalThis.FileSystemDirectoryHandle){const i=globalThis.FileSystemDirectoryHandle.prototype;i.resolve=async function(n){if(await n.isSameEntry(this))return[];const s=[{handle:this,path:[]}];for(;s.length;){let{handle:l,path:c}=s.pop();for await(const o of l.values()){if(await o.isSameEntry(n))return[...c,o.name];o.kind==="directory"&&s.push({handle:o,path:[...c,o.name]})}}return null};async function e(n){if(await(await navigator.storage.getDirectory()).resolve(n)===null)throw new DOMException(...G)}const t=i.entries;i.entries=async function*(){await e(this),yield*t.call(this)},i[Symbol.asyncIterator]=async function*(){yield*this.entries()};const r=i.removeEntry;i.removeEntry=async function(n,s={}){return r.call(this,n,s).catch(async l=>{throw l instanceof DOMException&&l.name==="UnknownError"&&!s.recursive&&!(await t.call(this).next()).done?new DOMException(...$):l})}}const _=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:S,default:S},Symbol.toStringTag,{value:"Module"})),{INVALID:Y,SYNTAX:D,GONE:X}=O,v=Symbol("adapter");class E extends T{[v];constructor(e){super(e),this[v]=e}async createWritable(e={}){return new m(await this[v].createWritable(e))}async getFile(){return this[v].getFile()}}Object.defineProperty(E.prototype,Symbol.toStringTag,{value:"FileSystemFileHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(E.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}});if(globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){const i=new WeakMap;let e;const t=()=>{let n,s;onmessage=async l=>{const c=l.ports[0],o=l.data;switch(o.type){case"open":const d=o.name;let p=await navigator.storage.getDirectory();for(const f of o.path)p=await p.getDirectoryHandle(f);n=await p.getFileHandle(d),s=await n.createSyncAccessHandle();break;case"write":s.write(o.data,{at:o.position}),s.flush();break;case"truncate":s.truncate(o.size);break;case"abort":case"close":s.close();break}c.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(n){if(!e){const a=`(${t.toString()})()`,g=new Blob([a],{type:"text/javascript"});e=URL.createObjectURL(g)}const s=new Worker(e,{type:"module"});let l=0;const c=new TextEncoder;let o=await this.getFile().then(a=>a.size);const d=a=>new Promise((g,M)=>{const F=new MessageChannel;F.port1.onmessage=P=>{P.data instanceof Error?M(P.data):g(P.data),F.port1.close(),F.port2.close(),F.port1.onmessage=null},s.postMessage(a,[F.port2])}),p=await navigator.storage.getDirectory(),f=await i.get(this),w=await p.resolve(f);if(w===null)throw new DOMException(...X);return await d({type:"open",path:w,name:this.name}),n?.keepExistingData===!1&&(await d({type:"truncate",size:0}),o=0),new m({start:a=>{},async write(a){if(a?.constructor===Object?a={...a}:a={type:"write",data:a,position:l},a.type==="write"){if(!("data"in a))throw await d({type:"close"}),new DOMException(...D("write requires a data argument"));if(a.position??=l,typeof a.data=="string")a.data=c.encode(a.data);else if(a.data instanceof ArrayBuffer)a.data=new Uint8Array(a.data);else if(!(a.data instanceof Uint8Array)&&ArrayBuffer.isView(a.data))a.data=new Uint8Array(a.data.buffer,a.data.byteOffset,a.data.byteLength);else if(!(a.data instanceof Uint8Array)){const g=await new Response(a.data).arrayBuffer();a.data=new Uint8Array(g)}Number.isInteger(a.position)&&a.position>=0&&(l=a.position),l+=a.data.byteLength,o+=a.data.byteLength}else if(a.type==="seek")if(Number.isInteger(a.position)&&a.position>=0){if(o<a.position)throw new DOMException(...Y);console.log("seeking",a),l=a.position;return}else throw await d({type:"close"}),new DOMException(...D("seek requires a position argument"));else if(a.type==="truncate")if(Number.isInteger(a.size)&&a.size>=0)o=a.size,l>o&&(l=o);else throw await d({type:"close"}),new DOMException(...D("truncate requires a size argument"));await d(a)},async close(){await d({type:"close"}),s.terminate()},async abort(a){await d({type:"abort",reason:a}),s.terminate()}})};const r=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...n){const s=await r.call(this,...n);return i.set(s,this),s}}const h=Object.freeze(Object.defineProperty({__proto__:null,FileSystemFileHandle:E,default:E},Symbol.toStringTag,{value:"Module"})),K=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:S,FileSystemFileHandle:E,FileSystemHandle:T,FileSystemWritableFileStream:m,getOriginPrivateDirectory:R,showDirectoryPicker:j,showOpenFilePicker:L,showSaveFilePicker:W},Symbol.toStringTag,{value:"Module"}));export{K as a,q as c,O as e};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/downloader-DcCTL3Wz-DCpITTU1.js","assets/index-BIyIgwS4.js","assets/index-Bjs8n_uU.css","assets/sandbox-ChAzL-i--CpDb1da2.js","assets/memory-B3L1Fctl-WytsaLFU.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c8 as b}from"./index-BIyIgwS4.js";const k=globalThis.showDirectoryPicker;async function j(i={}){if(k&&!i._preferPolyfill)return k(i);const e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0,e.style.position="fixed",e.style.top="-100000px",e.style.left="-100000px",document.body.appendChild(e);const t=Promise.resolve().then(()=>A);return await new Promise(r=>{e.addEventListener("change",r),e.click()}),t.then(r=>r.getDirHandlesFromInput(e))}const N={accepts:[]},x=globalThis.showOpenFilePicker;async function L(i={}){const e={...N,...i};if(x&&!i._preferPolyfill)return x(e);const t=document.createElement("input");t.type="file",t.multiple=e.multiple,t.accept=(e.accepts||[]).map(n=>[...(n.extensions||[]).map(s=>"."+s),...n.mimeTypes||[]]).flat().join(","),Object.assign(t.style,{position:"fixed",top:"-100000px",left:"-100000px"}),document.body.appendChild(t);const r=Promise.resolve().then(()=>A);return await new Promise(n=>{t.addEventListener("change",n,{once:!0}),t.click()}),t.remove(),r.then(n=>n.getFileHandlesFromInput(t))}const I=globalThis.showSaveFilePicker;async function W(i={}){if(I&&!i._preferPolyfill)return I(i);i._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),i.suggestedName=i._name);const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h),{FileHandle:t}=await b(async()=>{const{FileHandle:r}=await import("./downloader-DcCTL3Wz-DCpITTU1.js");return{FileHandle:r}},__vite__mapDeps([0,1,2]));return new e(new t(i.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){const i=this.webkitGetAsEntry(),[{FileHandle:e,FolderHandle:t},{FileSystemDirectoryHandle:r},{FileSystemFileHandle:n}]=await Promise.all([b(()=>import("./sandbox-ChAzL-i--CpDb1da2.js"),__vite__mapDeps([3,1,2])),Promise.resolve().then(()=>_),Promise.resolve().then(()=>h)]);return i.isFile?new n(new e(i,!1)):new r(new t(i,!1))});async function R(i,e={}){if(!i)return globalThis.navigator?.storage?.getDirectory()||globalThis.getOriginPrivateDirectory();const{FileSystemDirectoryHandle:t}=await Promise.resolve().then(()=>_),r=await i,n=await(r.default?r.default(e):r(e));return new t(n)}const q={WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,DOMException:globalThis.DOMException,Blob:globalThis.Blob,File:globalThis.File},{WritableStream:z}=q;class m extends z{#e;constructor(e){super(e),this.#e=e,Object.setPrototypeOf(this,m.prototype),this._closed=!1}async close(){this._closed=!0;const e=this.getWriter(),t=e.close();return e.releaseLock(),t}seek(e){return this.write({type:"seek",position:e})}truncate(e){return this.write({type:"truncate",size:e})}write(e){if(this._closed)return Promise.reject(new TypeError("Cannot write to a CLOSED writable stream"));const t=this.getWriter(),r=t.write(e);return t.releaseLock(),r}}Object.defineProperty(m.prototype,Symbol.toStringTag,{value:"FileSystemWritableFileStream",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(m.prototype,{close:{enumerable:!0},seek:{enumerable:!0},truncate:{enumerable:!0},write:{enumerable:!0}});globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable&&!globalThis.FileSystemWritableFileStream&&(globalThis.FileSystemWritableFileStream=m);const y=Symbol("adapter");class T{[y];name;kind;constructor(e){this.kind=e.kind,this.name=e.name,this[y]=e}async queryPermission(e={}){const{mode:t="read"}=e,r=this[y];if(r.queryPermission)return r.queryPermission({mode:t});if(t==="read")return"granted";if(t==="readwrite")return r.writable?"granted":"denied";throw new TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async requestPermission({mode:e="read"}={}){const t=this[y];if(t.requestPermission)return t.requestPermission({mode:e});if(e==="read")return"granted";if(e==="readwrite")return t.writable?"granted":"denied";throw new TypeError(`Mode ${e} must be 'read' or 'readwrite'`)}async remove(e={}){await this[y].remove(e)}async isSameEntry(e){return this===e?!0:!e||typeof e!="object"||this.kind!==e.kind||!e[y]?!1:this[y].isSameEntry(e[y])}}Object.defineProperty(T.prototype,Symbol.toStringTag,{value:"FileSystemHandle",writable:!1,enumerable:!1,configurable:!0});globalThis.FileSystemHandle&&(globalThis.FileSystemHandle.prototype.queryPermission??=function(i){return"granted"});const O={INVALID:["seeking position failed.","InvalidStateError"],GONE:["A requested file or directory could not be found at the time an operation was processed.","NotFoundError"],MISMATCH:["The path supplied exists, but was not an entry of requested type.","TypeMismatchError"],MOD_ERR:["The object can not be modified in this way.","InvalidModificationError"],SYNTAX:i=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${i}`,"SyntaxError"],SECURITY:["It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.","SecurityError"],DISALLOWED:["The request is not allowed by the user agent or the platform in the current context.","NotAllowedError"]},U={writable:globalThis.WritableStream};async function V(i){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");const[e,t,r]=await Promise.all([b(()=>import("./memory-B3L1Fctl-WytsaLFU.js"),__vite__mapDeps([4,1,2])),b(()=>import("./sandbox-ChAzL-i--CpDb1da2.js"),__vite__mapDeps([3,1,2])),Promise.resolve().then(()=>_)]),n=new e.FolderHandle("",!1);return n._entries=i.map(s=>s.isFile?new t.FileHandle(s,!1):new t.FolderHandle(s,!1)),new r.FileSystemDirectoryHandle(n)}async function B(i){const{FolderHandle:e,FileHandle:t}=await b(async()=>{const{FolderHandle:c,FileHandle:o}=await import("./memory-B3L1Fctl-WytsaLFU.js");return{FolderHandle:c,FileHandle:o}},__vite__mapDeps([4,1,2])),{FileSystemDirectoryHandle:r}=await Promise.resolve().then(()=>_),n=Array.from(i.files),s=n[0].webkitRelativePath.split("/",1)[0],l=new e(s,!1);return n.forEach(c=>{const o=c.webkitRelativePath.split("/");o.shift();const d=o.pop(),p=o.reduce((f,w)=>(f._entries[w]||(f._entries[w]=new e(w,!1)),f._entries[w]),l);p._entries[d]=new t(c.name,c,!1)}),new r(l)}async function C(i){const{FileHandle:e}=await b(async()=>{const{FileHandle:r}=await import("./memory-B3L1Fctl-WytsaLFU.js");return{FileHandle:r}},__vite__mapDeps([4,1,2])),{FileSystemFileHandle:t}=await Promise.resolve().then(()=>h);return Array.from(i.files).map(r=>new t(new e(r.name,r,!1)))}const A=Object.freeze(Object.defineProperty({__proto__:null,config:U,errors:O,fromDataTransfer:V,getDirHandlesFromInput:B,getFileHandlesFromInput:C},Symbol.toStringTag,{value:"Module"})),{GONE:G,MOD_ERR:$}=O,u=Symbol("adapter");let S=class H extends T{[u];constructor(e){super(e),this[u]=e}async getDirectoryHandle(e,t={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");t.create=!!t.create;const r=await this[u].getDirectoryHandle(e,t);return new H(r)}async*entries(){const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h);for await(const[t,r]of this[u].entries())yield[r.name,r.kind==="file"?new e(r):new H(r)]}async*getEntries(){const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h);console.warn("deprecated, use .entries() instead");for await(let t of this[u].entries())yield t.kind==="file"?new e(t):new H(t)}async getFileHandle(e,t={}){const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>h);if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");t.create=!!t.create;const n=await this[u].getFileHandle(e,t);return new r(n)}async removeEntry(e,t={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");return t.recursive=!!t.recursive,this[u].removeEntry(e,t)}async resolve(e){if(await e.isSameEntry(this))return[];const t=[{handle:this,path:[]}];for(;t.length;){let{handle:r,path:n}=t.pop();for await(const s of r.values()){if(await s.isSameEntry(e))return[...n,s.name];s.kind==="directory"&&t.push({handle:s,path:[...n,s.name]})}}return null}async*keys(){for await(const[e]of this[u].entries())yield e}async*values(){for await(const[e,t]of this)yield t}[Symbol.asyncIterator](){return this.entries()}};Object.defineProperty(S.prototype,Symbol.toStringTag,{value:"FileSystemDirectoryHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(S.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}});if(globalThis.FileSystemDirectoryHandle){const i=globalThis.FileSystemDirectoryHandle.prototype;i.resolve=async function(n){if(await n.isSameEntry(this))return[];const s=[{handle:this,path:[]}];for(;s.length;){let{handle:l,path:c}=s.pop();for await(const o of l.values()){if(await o.isSameEntry(n))return[...c,o.name];o.kind==="directory"&&s.push({handle:o,path:[...c,o.name]})}}return null};async function e(n){if(await(await navigator.storage.getDirectory()).resolve(n)===null)throw new DOMException(...G)}const t=i.entries;i.entries=async function*(){await e(this),yield*t.call(this)},i[Symbol.asyncIterator]=async function*(){yield*this.entries()};const r=i.removeEntry;i.removeEntry=async function(n,s={}){return r.call(this,n,s).catch(async l=>{throw l instanceof DOMException&&l.name==="UnknownError"&&!s.recursive&&!(await t.call(this).next()).done?new DOMException(...$):l})}}const _=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:S,default:S},Symbol.toStringTag,{value:"Module"})),{INVALID:Y,SYNTAX:D,GONE:X}=O,v=Symbol("adapter");class E extends T{[v];constructor(e){super(e),this[v]=e}async createWritable(e={}){return new m(await this[v].createWritable(e))}async getFile(){return this[v].getFile()}}Object.defineProperty(E.prototype,Symbol.toStringTag,{value:"FileSystemFileHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(E.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}});if(globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){const i=new WeakMap;let e;const t=()=>{let n,s;onmessage=async l=>{const c=l.ports[0],o=l.data;switch(o.type){case"open":const d=o.name;let p=await navigator.storage.getDirectory();for(const f of o.path)p=await p.getDirectoryHandle(f);n=await p.getFileHandle(d),s=await n.createSyncAccessHandle();break;case"write":s.write(o.data,{at:o.position}),s.flush();break;case"truncate":s.truncate(o.size);break;case"abort":case"close":s.close();break}c.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(n){if(!e){const a=`(${t.toString()})()`,g=new Blob([a],{type:"text/javascript"});e=URL.createObjectURL(g)}const s=new Worker(e,{type:"module"});let l=0;const c=new TextEncoder;let o=await this.getFile().then(a=>a.size);const d=a=>new Promise((g,M)=>{const F=new MessageChannel;F.port1.onmessage=P=>{P.data instanceof Error?M(P.data):g(P.data),F.port1.close(),F.port2.close(),F.port1.onmessage=null},s.postMessage(a,[F.port2])}),p=await navigator.storage.getDirectory(),f=await i.get(this),w=await p.resolve(f);if(w===null)throw new DOMException(...X);return await d({type:"open",path:w,name:this.name}),n?.keepExistingData===!1&&(await d({type:"truncate",size:0}),o=0),new m({start:a=>{},async write(a){if(a?.constructor===Object?a={...a}:a={type:"write",data:a,position:l},a.type==="write"){if(!("data"in a))throw await d({type:"close"}),new DOMException(...D("write requires a data argument"));if(a.position??=l,typeof a.data=="string")a.data=c.encode(a.data);else if(a.data instanceof ArrayBuffer)a.data=new Uint8Array(a.data);else if(!(a.data instanceof Uint8Array)&&ArrayBuffer.isView(a.data))a.data=new Uint8Array(a.data.buffer,a.data.byteOffset,a.data.byteLength);else if(!(a.data instanceof Uint8Array)){const g=await new Response(a.data).arrayBuffer();a.data=new Uint8Array(g)}Number.isInteger(a.position)&&a.position>=0&&(l=a.position),l+=a.data.byteLength,o+=a.data.byteLength}else if(a.type==="seek")if(Number.isInteger(a.position)&&a.position>=0){if(o<a.position)throw new DOMException(...Y);console.log("seeking",a),l=a.position;return}else throw await d({type:"close"}),new DOMException(...D("seek requires a position argument"));else if(a.type==="truncate")if(Number.isInteger(a.size)&&a.size>=0)o=a.size,l>o&&(l=o);else throw await d({type:"close"}),new DOMException(...D("truncate requires a size argument"));await d(a)},async close(){await d({type:"close"}),s.terminate()},async abort(a){await d({type:"abort",reason:a}),s.terminate()}})};const r=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...n){const s=await r.call(this,...n);return i.set(s,this),s}}const h=Object.freeze(Object.defineProperty({__proto__:null,FileSystemFileHandle:E,default:E},Symbol.toStringTag,{value:"Module"})),K=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:S,FileSystemFileHandle:E,FileSystemHandle:T,FileSystemWritableFileStream:m,getOriginPrivateDirectory:R,showDirectoryPicker:j,showOpenFilePicker:L,showSaveFilePicker:W},Symbol.toStringTag,{value:"Module"}));export{K as a,q as c,O as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{X as it}from"./index-BxpEVUJq.js";function rt(z,u){for(var p=0;p<u.length;p++){const S=u[p];if(typeof S!="string"&&!Array.isArray(S)){for(const O in S)if(O!=="default"&&!(O in z)){const M=Object.getOwnPropertyDescriptor(S,O);M&&Object.defineProperty(z,O,M.get?M:{enumerable:!0,get:()=>S[O]})}}}return Object.freeze(Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}))}var ke={exports:{}},Le;function at(){return Le||(Le=1,(function(z){(function(u){if(typeof window>"u")return;var p=!0,S=10,O="",M=0,j="",J=null,ie="",D=!1,Pe={resize:1,click:1},U=128,re=!0,R=1,X="bodyOffset",h=X,ae=!0,ce="",k={},I=32,ue=null,_=!1,V=!1,q="[iFrameSizer]",se=q.length,H="",le={max:1,min:1,bodyScroll:1,documentElementScroll:1},Y="child",fe=window.parent,L="*",K=0,W=!1,de=null,F=16,P=1,me="scroll",v=me,je=window,Q=function(){T("onMessage function not defined")},$=function(){},G=function(){},Z={height:function(){return T("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return T("Custom width calculation function not defined"),document.body.scrollWidth}},ee={},ge=!1;function he(){}try{var pe=Object.create({},{passive:{get:function(){ge=!0}}});window.addEventListener("test",he,pe),window.removeEventListener("test",he,pe)}catch{}function C(e,t,n,o){e.addEventListener(t,n,ge?o||{}:!1)}function De(e,t,n){e.removeEventListener(t,n,!1)}function ve(e){return e.charAt(0).toUpperCase()+e.slice(1)}function qe(e){var t,n,o,a=null,l=0,m=function(){l=Date.now(),a=null,o=e.apply(t,n),a||(t=n=null)};return function(){var d=Date.now();l||(l=d);var c=F-(d-l);return t=this,n=arguments,c<=0||c>F?(a&&(clearTimeout(a),a=null),l=d,o=e.apply(t,n),a||(t=n=null)):a||(a=setTimeout(m,c)),o}}function ye(e){return q+"["+H+"] "+e}function i(e){_&&typeof window.console=="object"&&console.log(ye(e))}function T(e){typeof window.console=="object"&&console.warn(ye(e))}function He(){We(),i("Initialising iFrame ("+window.location.href+")"),Je(),Xe(),te("background",O),te("padding",ie),Ke(),Te(),Ee(),_e(),Ge(),$e(),Oe(),k=Qe(),A("init","Init message from host page"),$()}function We(){function e(n){return n==="true"}var t=ce.slice(se).split(":");H=t[0],M=u===t[1]?M:Number(t[1]),D=u===t[2]?D:e(t[2]),_=u===t[3]?_:e(t[3]),I=u===t[4]?I:Number(t[4]),p=u===t[6]?p:e(t[6]),j=t[7],h=u===t[8]?h:t[8],O=t[9],ie=t[10],K=u===t[11]?K:Number(t[11]),k.enable=u===t[12]?!1:e(t[12]),Y=u===t[13]?Y:t[13],v=u===t[14]?v:t[14],V=u===t[15]?V:e(t[15])}function Be(e){var t=e.split("Callback");if(t.length===2){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],T("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function Je(){function e(){var n=window.iFrameResizer;i("Reading data from page: "+JSON.stringify(n)),Object.keys(n).forEach(Be,n),Q="onMessage"in n?n.onMessage:Q,$="onReady"in n?n.onReady:$,L="targetOrigin"in n?n.targetOrigin:L,h="heightCalculationMethod"in n?n.heightCalculationMethod:h,v="widthCalculationMethod"in n?n.widthCalculationMethod:v}function t(n,o){return typeof n=="function"&&(i("Setup custom "+o+"CalcMethod"),Z[o]=n,n="custom"),n}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),h=t(h,"height"),v=t(v,"width")),i("TargetOrigin for parent set to: "+L)}function Ue(e,t){return t.indexOf("-")!==-1&&(T("Negative CSS value ignored for "+e),t=""),t}function te(e,t){u!==t&&t!==""&&t!=="null"&&(document.body.style[e]=t,i("Body "+e+' set to "'+t+'"'))}function Xe(){u===j&&(j=M+"px"),te("margin",Ue("margin",j))}function _e(){document.documentElement.style.height="",document.body.style.height="",i('HTML & body height set to "auto"')}function g(e){var t={add:function(n){function o(){A(e.eventName,e.eventType)}ee[n]=o,C(window,n,o,{passive:!0})},remove:function(n){var o=ee[n];delete ee[n],De(window,n,o)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),i(ve(e.method)+" event listener: "+e.eventType)}function we(e){g({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),g({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),g({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),g({method:e,eventType:"Input",eventName:"input"}),g({method:e,eventType:"Mouse Up",eventName:"mouseup"}),g({method:e,eventType:"Mouse Down",eventName:"mousedown"}),g({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),g({method:e,eventType:"Print",eventNames:["afterprint","beforeprint"]}),g({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),g({method:e,eventType:"Touch Start",eventName:"touchstart"}),g({method:e,eventType:"Touch End",eventName:"touchend"}),g({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),g({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),g({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),g({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),Y==="child"&&g({method:e,eventType:"IFrame Resized",eventName:"resize"})}function be(e,t,n,o){return t!==e&&(e in n||(T(e+" is not a valid option for "+o+"CalculationMethod."),e=t),i(o+' calculation method set to "'+e+'"')),e}function Te(){h=be(h,X,E,"height")}function Ee(){v=be(v,me,N,"width")}function Oe(){p===!0?(we("add"),et()):i("Auto Resize disabled")}function Ve(){J!==null&&J.disconnect()}function Ye(){we("remove"),Ve(),clearInterval(ue)}function Ke(){var e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e)}function Qe(){function e(){return{x:window.pageXOffset===u?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===u?document.documentElement.scrollTop:window.pageYOffset}}function t(c){var s=c.getBoundingClientRect(),f=e();return{x:parseInt(s.left,10)+parseInt(f.x,10),y:parseInt(s.top,10)+parseInt(f.y,10)}}function n(c){function s(b){var x=t(b);i("Moving to in page link (#"+f+") at x: "+x.x+" y: "+x.y),y(x.y,x.x,"scrollToOffset")}var f=c.split("#")[1]||c,r=decodeURIComponent(f),w=document.getElementById(r)||document.getElementsByName(r)[0];u===w?(i("In page link (#"+f+") not found in iFrame, so sending to parent"),y(0,0,"inPageLink","#"+f)):s(w)}function o(){var c=window.location.hash,s=window.location.href;c!==""&&c!=="#"&&n(s)}function a(){function c(s){function f(r){r.preventDefault(),n(this.getAttribute("href"))}s.getAttribute("href")!=="#"&&C(s,"click",f)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),c)}function l(){C(window,"hashchange",o)}function m(){setTimeout(o,U)}function d(){Array.prototype.forEach&&document.querySelectorAll?(i("Setting up location.hash handlers"),a(),l(),m()):T("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return k.enable?d():i("In page linking not enabled"),{findTarget:n}}function $e(){if(V!==!0)return;function e(n){y(0,0,n.type,n.screenY+":"+n.screenX)}function t(n,o){i("Add event listener: "+o),C(window.document,n,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}function Ge(){i("Enable public methods"),je.parentIFrame={autoResize:function(e){return e===!0&&p===!1?(p=!0,Oe()):e===!1&&p===!0&&(p=!1,Ye()),y(0,0,"autoResize",JSON.stringify(p)),p},close:function(){y(0,0,"close")},getId:function(){return H},getPageInfo:function(e){typeof e=="function"?(G=e,y(0,0,"pageInfo")):(G=function(){},y(0,0,"pageInfoStop"))},moveToAnchor:function(e){k.findTarget(e)},reset:function(){xe("parentIFrame.reset")},scrollTo:function(e,t){y(t,e,"scrollTo")},scrollToOffset:function(e,t){y(t,e,"scrollToOffset")},sendMessage:function(e,t){y(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod:function(e){h=e,Te()},setWidthCalculationMethod:function(e){v=e,Ee()},setTargetOrigin:function(e){i("Set targetOrigin: "+e),L=e},size:function(e,t){var n=""+(e||"")+(t?","+t:"");A("size","parentIFrame.size("+n+")",e,t)}}}function Se(){I!==0&&(i("setInterval: "+I+"ms"),ue=setInterval(function(){A("interval","setInterval: "+I)},Math.abs(I)))}function Ze(){function e(r){function w(b){b.complete===!1&&(i("Attach listeners to "+b.src),b.addEventListener("load",a,!1),b.addEventListener("error",l,!1),c.push(b))}r.type==="attributes"&&r.attributeName==="src"?w(r.target):r.type==="childList"&&Array.prototype.forEach.call(r.target.querySelectorAll("img"),w)}function t(r){c.splice(c.indexOf(r),1)}function n(r){i("Remove listeners from "+r.src),r.removeEventListener("load",a,!1),r.removeEventListener("error",l,!1),t(r)}function o(r,w,b){n(r.target),A(w,b+": "+r.target.src)}function a(r){o(r,"imageLoad","Image loaded")}function l(r){o(r,"imageLoadFailed","Image load failed")}function m(r){A("mutationObserver","mutationObserver: "+r[0].target+" "+r[0].type),r.forEach(e)}function d(){var r=document.querySelector("body"),w={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};return f=new s(m),i("Create body MutationObserver"),f.observe(r,w),f}var c=[],s=window.MutationObserver||window.WebKitMutationObserver,f=d();return{disconnect:function(){"disconnect"in f&&(i("Disconnect body MutationObserver"),f.disconnect(),c.forEach(n))}}}function et(){var e=0>I;window.MutationObserver||window.WebKitMutationObserver?e?Se():J=Ze():(i("MutationObserver not supported in this browser!"),Se())}function ne(e,t){var n=0;return t=t||document.body,n=document.defaultView.getComputedStyle(t,null),n=n===null?0:n[e],parseInt(n,S)}function tt(e){e>F/2&&(F=2*e,i("Event throttle increased to "+F+"ms"))}function oe(e,t){for(var n=t.length,o=0,a=0,l=ve(e),m=Date.now(),d=0;d<n;d++)o=t[d].getBoundingClientRect()[e]+ne("margin"+l,t[d]),o>a&&(a=o);return m=Date.now()-m,i("Parsed "+n+" HTML elements"),i("Element position calculated in "+m+"ms"),tt(m),a}function B(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function Me(e,t){function n(){return T("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")}var o=document.querySelectorAll("["+t+"]");return o.length===0&&n(),oe(e,o)}function Ie(){return document.querySelectorAll("body *")}var E={bodyOffset:function(){return document.body.offsetHeight+ne("marginTop")+ne("marginBottom")},offset:function(){return E.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return Z.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,B(E))},min:function(){return Math.min.apply(null,B(E))},grow:function(){return E.max()},lowestElement:function(){return Math.max(E.bodyOffset()||E.documentElementOffset(),oe("bottom",Ie()))},taggedElement:function(){return Me("bottom","data-iframe-height")}},N={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return Z.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(N.bodyScroll(),N.documentElementScroll())},max:function(){return Math.max.apply(null,B(N))},min:function(){return Math.min.apply(null,B(N))},rightMostElement:function(){return oe("right",Ie())},taggedElement:function(){return Me("right","data-iframe-width")}};function Ne(e,t,n,o){function a(){R=f,P=r,y(R,P,e)}function l(){function w(b,x){var ot=Math.abs(b-x)<=K;return!ot}return f=u===n?E[h]():n,r=u===o?N[v]():o,w(R,f)||D&&w(P,r)}function m(){return!(e in{init:1,interval:1,size:1})}function d(){return h in le||D&&v in le}function c(){i("No change in size detected")}function s(){m()&&d()?xe(t):e in{interval:1}||c()}var f,r;l()||e==="init"?(Ae(),a()):s()}var nt=qe(Ne);function A(e,t,n,o){function a(){e in{reset:1,resetPage:1,init:1}||i("Trigger event: "+t)}function l(){return W&&e in Pe}l()?i("Trigger event cancelled: "+e):(a(),e==="init"?Ne(e,t,n,o):nt(e,t,n,o))}function Ae(){W||(W=!0,i("Trigger event lock on")),clearTimeout(de),de=setTimeout(function(){W=!1,i("Trigger event lock off"),i("--")},U)}function Ce(e){R=E[h](),P=N[v](),y(R,P,e)}function xe(e){var t=h;h=X,i("Reset trigger event: "+e),Ae(),Ce("reset"),h=t}function y(e,t,n,o,a){function l(){u===a?a=L:i("Message targetOrigin: "+a)}function m(){var d=e+":"+t,c=H+":"+d+":"+n+(u===o?"":":"+o);i("Sending message to host page ("+c+")"),fe.postMessage(q+c,a)}l(),m()}function ze(e){var t={init:function(){ce=e.data,fe=e.source,He(),re=!1,setTimeout(function(){ae=!1},U)},reset:function(){ae?i("Page reset ignored by init"):(i("Page size reset by host page"),Ce("resetPage"))},resize:function(){A("resizeParent","Parent window requested size check")},moveToAnchor:function(){k.findTarget(a())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var s=a();i("PageInfoFromParent called from parent: "+s),G(JSON.parse(s)),i(" --")},message:function(){var s=a();i("onMessage called from parent: "+s),Q(JSON.parse(s)),i(" --")}};function n(){return q===(""+e.data).slice(0,se)}function o(){return e.data.split("]")[1].split(":")[0]}function a(){return e.data.slice(e.data.indexOf(":")+1)}function l(){return!z.exports&&"iFrameResize"in window||window.jQuery!==u&&"iFrameResize"in window.jQuery.prototype}function m(){return e.data.split(":")[2]in{true:1,false:1}}function d(){var s=o();s in t?t[s]():!l()&&!m()&&T("Unexpected message ("+e.data+")")}function c(){re===!1?d():m()?t.init():i('Ignored message of type "'+o()+'". Received before initialization.')}n()&&c()}function Re(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeResizer"in window||(window.iframeChildListener=function(e){ze({data:e})},C(window,"message",ze),C(window,"readystatechange",Re),Re())})()})(ke)),ke.exports}var Fe=at();const ct=it(Fe),st=rt({__proto__:null,default:ct},[Fe]);export{st as i};
|
|
1
|
+
import{X as it}from"./index-BIyIgwS4.js";function rt(z,u){for(var p=0;p<u.length;p++){const S=u[p];if(typeof S!="string"&&!Array.isArray(S)){for(const O in S)if(O!=="default"&&!(O in z)){const M=Object.getOwnPropertyDescriptor(S,O);M&&Object.defineProperty(z,O,M.get?M:{enumerable:!0,get:()=>S[O]})}}}return Object.freeze(Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}))}var ke={exports:{}},Le;function at(){return Le||(Le=1,(function(z){(function(u){if(typeof window>"u")return;var p=!0,S=10,O="",M=0,j="",J=null,ie="",D=!1,Pe={resize:1,click:1},U=128,re=!0,R=1,X="bodyOffset",h=X,ae=!0,ce="",k={},I=32,ue=null,_=!1,V=!1,q="[iFrameSizer]",se=q.length,H="",le={max:1,min:1,bodyScroll:1,documentElementScroll:1},Y="child",fe=window.parent,L="*",K=0,W=!1,de=null,F=16,P=1,me="scroll",v=me,je=window,Q=function(){T("onMessage function not defined")},$=function(){},G=function(){},Z={height:function(){return T("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return T("Custom width calculation function not defined"),document.body.scrollWidth}},ee={},ge=!1;function he(){}try{var pe=Object.create({},{passive:{get:function(){ge=!0}}});window.addEventListener("test",he,pe),window.removeEventListener("test",he,pe)}catch{}function C(e,t,n,o){e.addEventListener(t,n,ge?o||{}:!1)}function De(e,t,n){e.removeEventListener(t,n,!1)}function ve(e){return e.charAt(0).toUpperCase()+e.slice(1)}function qe(e){var t,n,o,a=null,l=0,m=function(){l=Date.now(),a=null,o=e.apply(t,n),a||(t=n=null)};return function(){var d=Date.now();l||(l=d);var c=F-(d-l);return t=this,n=arguments,c<=0||c>F?(a&&(clearTimeout(a),a=null),l=d,o=e.apply(t,n),a||(t=n=null)):a||(a=setTimeout(m,c)),o}}function ye(e){return q+"["+H+"] "+e}function i(e){_&&typeof window.console=="object"&&console.log(ye(e))}function T(e){typeof window.console=="object"&&console.warn(ye(e))}function He(){We(),i("Initialising iFrame ("+window.location.href+")"),Je(),Xe(),te("background",O),te("padding",ie),Ke(),Te(),Ee(),_e(),Ge(),$e(),Oe(),k=Qe(),A("init","Init message from host page"),$()}function We(){function e(n){return n==="true"}var t=ce.slice(se).split(":");H=t[0],M=u===t[1]?M:Number(t[1]),D=u===t[2]?D:e(t[2]),_=u===t[3]?_:e(t[3]),I=u===t[4]?I:Number(t[4]),p=u===t[6]?p:e(t[6]),j=t[7],h=u===t[8]?h:t[8],O=t[9],ie=t[10],K=u===t[11]?K:Number(t[11]),k.enable=u===t[12]?!1:e(t[12]),Y=u===t[13]?Y:t[13],v=u===t[14]?v:t[14],V=u===t[15]?V:e(t[15])}function Be(e){var t=e.split("Callback");if(t.length===2){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],T("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function Je(){function e(){var n=window.iFrameResizer;i("Reading data from page: "+JSON.stringify(n)),Object.keys(n).forEach(Be,n),Q="onMessage"in n?n.onMessage:Q,$="onReady"in n?n.onReady:$,L="targetOrigin"in n?n.targetOrigin:L,h="heightCalculationMethod"in n?n.heightCalculationMethod:h,v="widthCalculationMethod"in n?n.widthCalculationMethod:v}function t(n,o){return typeof n=="function"&&(i("Setup custom "+o+"CalcMethod"),Z[o]=n,n="custom"),n}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),h=t(h,"height"),v=t(v,"width")),i("TargetOrigin for parent set to: "+L)}function Ue(e,t){return t.indexOf("-")!==-1&&(T("Negative CSS value ignored for "+e),t=""),t}function te(e,t){u!==t&&t!==""&&t!=="null"&&(document.body.style[e]=t,i("Body "+e+' set to "'+t+'"'))}function Xe(){u===j&&(j=M+"px"),te("margin",Ue("margin",j))}function _e(){document.documentElement.style.height="",document.body.style.height="",i('HTML & body height set to "auto"')}function g(e){var t={add:function(n){function o(){A(e.eventName,e.eventType)}ee[n]=o,C(window,n,o,{passive:!0})},remove:function(n){var o=ee[n];delete ee[n],De(window,n,o)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),i(ve(e.method)+" event listener: "+e.eventType)}function we(e){g({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),g({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),g({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),g({method:e,eventType:"Input",eventName:"input"}),g({method:e,eventType:"Mouse Up",eventName:"mouseup"}),g({method:e,eventType:"Mouse Down",eventName:"mousedown"}),g({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),g({method:e,eventType:"Print",eventNames:["afterprint","beforeprint"]}),g({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),g({method:e,eventType:"Touch Start",eventName:"touchstart"}),g({method:e,eventType:"Touch End",eventName:"touchend"}),g({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),g({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),g({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),g({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),Y==="child"&&g({method:e,eventType:"IFrame Resized",eventName:"resize"})}function be(e,t,n,o){return t!==e&&(e in n||(T(e+" is not a valid option for "+o+"CalculationMethod."),e=t),i(o+' calculation method set to "'+e+'"')),e}function Te(){h=be(h,X,E,"height")}function Ee(){v=be(v,me,N,"width")}function Oe(){p===!0?(we("add"),et()):i("Auto Resize disabled")}function Ve(){J!==null&&J.disconnect()}function Ye(){we("remove"),Ve(),clearInterval(ue)}function Ke(){var e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e)}function Qe(){function e(){return{x:window.pageXOffset===u?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===u?document.documentElement.scrollTop:window.pageYOffset}}function t(c){var s=c.getBoundingClientRect(),f=e();return{x:parseInt(s.left,10)+parseInt(f.x,10),y:parseInt(s.top,10)+parseInt(f.y,10)}}function n(c){function s(b){var x=t(b);i("Moving to in page link (#"+f+") at x: "+x.x+" y: "+x.y),y(x.y,x.x,"scrollToOffset")}var f=c.split("#")[1]||c,r=decodeURIComponent(f),w=document.getElementById(r)||document.getElementsByName(r)[0];u===w?(i("In page link (#"+f+") not found in iFrame, so sending to parent"),y(0,0,"inPageLink","#"+f)):s(w)}function o(){var c=window.location.hash,s=window.location.href;c!==""&&c!=="#"&&n(s)}function a(){function c(s){function f(r){r.preventDefault(),n(this.getAttribute("href"))}s.getAttribute("href")!=="#"&&C(s,"click",f)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),c)}function l(){C(window,"hashchange",o)}function m(){setTimeout(o,U)}function d(){Array.prototype.forEach&&document.querySelectorAll?(i("Setting up location.hash handlers"),a(),l(),m()):T("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return k.enable?d():i("In page linking not enabled"),{findTarget:n}}function $e(){if(V!==!0)return;function e(n){y(0,0,n.type,n.screenY+":"+n.screenX)}function t(n,o){i("Add event listener: "+o),C(window.document,n,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}function Ge(){i("Enable public methods"),je.parentIFrame={autoResize:function(e){return e===!0&&p===!1?(p=!0,Oe()):e===!1&&p===!0&&(p=!1,Ye()),y(0,0,"autoResize",JSON.stringify(p)),p},close:function(){y(0,0,"close")},getId:function(){return H},getPageInfo:function(e){typeof e=="function"?(G=e,y(0,0,"pageInfo")):(G=function(){},y(0,0,"pageInfoStop"))},moveToAnchor:function(e){k.findTarget(e)},reset:function(){xe("parentIFrame.reset")},scrollTo:function(e,t){y(t,e,"scrollTo")},scrollToOffset:function(e,t){y(t,e,"scrollToOffset")},sendMessage:function(e,t){y(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod:function(e){h=e,Te()},setWidthCalculationMethod:function(e){v=e,Ee()},setTargetOrigin:function(e){i("Set targetOrigin: "+e),L=e},size:function(e,t){var n=""+(e||"")+(t?","+t:"");A("size","parentIFrame.size("+n+")",e,t)}}}function Se(){I!==0&&(i("setInterval: "+I+"ms"),ue=setInterval(function(){A("interval","setInterval: "+I)},Math.abs(I)))}function Ze(){function e(r){function w(b){b.complete===!1&&(i("Attach listeners to "+b.src),b.addEventListener("load",a,!1),b.addEventListener("error",l,!1),c.push(b))}r.type==="attributes"&&r.attributeName==="src"?w(r.target):r.type==="childList"&&Array.prototype.forEach.call(r.target.querySelectorAll("img"),w)}function t(r){c.splice(c.indexOf(r),1)}function n(r){i("Remove listeners from "+r.src),r.removeEventListener("load",a,!1),r.removeEventListener("error",l,!1),t(r)}function o(r,w,b){n(r.target),A(w,b+": "+r.target.src)}function a(r){o(r,"imageLoad","Image loaded")}function l(r){o(r,"imageLoadFailed","Image load failed")}function m(r){A("mutationObserver","mutationObserver: "+r[0].target+" "+r[0].type),r.forEach(e)}function d(){var r=document.querySelector("body"),w={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};return f=new s(m),i("Create body MutationObserver"),f.observe(r,w),f}var c=[],s=window.MutationObserver||window.WebKitMutationObserver,f=d();return{disconnect:function(){"disconnect"in f&&(i("Disconnect body MutationObserver"),f.disconnect(),c.forEach(n))}}}function et(){var e=0>I;window.MutationObserver||window.WebKitMutationObserver?e?Se():J=Ze():(i("MutationObserver not supported in this browser!"),Se())}function ne(e,t){var n=0;return t=t||document.body,n=document.defaultView.getComputedStyle(t,null),n=n===null?0:n[e],parseInt(n,S)}function tt(e){e>F/2&&(F=2*e,i("Event throttle increased to "+F+"ms"))}function oe(e,t){for(var n=t.length,o=0,a=0,l=ve(e),m=Date.now(),d=0;d<n;d++)o=t[d].getBoundingClientRect()[e]+ne("margin"+l,t[d]),o>a&&(a=o);return m=Date.now()-m,i("Parsed "+n+" HTML elements"),i("Element position calculated in "+m+"ms"),tt(m),a}function B(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function Me(e,t){function n(){return T("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")}var o=document.querySelectorAll("["+t+"]");return o.length===0&&n(),oe(e,o)}function Ie(){return document.querySelectorAll("body *")}var E={bodyOffset:function(){return document.body.offsetHeight+ne("marginTop")+ne("marginBottom")},offset:function(){return E.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return Z.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,B(E))},min:function(){return Math.min.apply(null,B(E))},grow:function(){return E.max()},lowestElement:function(){return Math.max(E.bodyOffset()||E.documentElementOffset(),oe("bottom",Ie()))},taggedElement:function(){return Me("bottom","data-iframe-height")}},N={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return Z.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(N.bodyScroll(),N.documentElementScroll())},max:function(){return Math.max.apply(null,B(N))},min:function(){return Math.min.apply(null,B(N))},rightMostElement:function(){return oe("right",Ie())},taggedElement:function(){return Me("right","data-iframe-width")}};function Ne(e,t,n,o){function a(){R=f,P=r,y(R,P,e)}function l(){function w(b,x){var ot=Math.abs(b-x)<=K;return!ot}return f=u===n?E[h]():n,r=u===o?N[v]():o,w(R,f)||D&&w(P,r)}function m(){return!(e in{init:1,interval:1,size:1})}function d(){return h in le||D&&v in le}function c(){i("No change in size detected")}function s(){m()&&d()?xe(t):e in{interval:1}||c()}var f,r;l()||e==="init"?(Ae(),a()):s()}var nt=qe(Ne);function A(e,t,n,o){function a(){e in{reset:1,resetPage:1,init:1}||i("Trigger event: "+t)}function l(){return W&&e in Pe}l()?i("Trigger event cancelled: "+e):(a(),e==="init"?Ne(e,t,n,o):nt(e,t,n,o))}function Ae(){W||(W=!0,i("Trigger event lock on")),clearTimeout(de),de=setTimeout(function(){W=!1,i("Trigger event lock off"),i("--")},U)}function Ce(e){R=E[h](),P=N[v](),y(R,P,e)}function xe(e){var t=h;h=X,i("Reset trigger event: "+e),Ae(),Ce("reset"),h=t}function y(e,t,n,o,a){function l(){u===a?a=L:i("Message targetOrigin: "+a)}function m(){var d=e+":"+t,c=H+":"+d+":"+n+(u===o?"":":"+o);i("Sending message to host page ("+c+")"),fe.postMessage(q+c,a)}l(),m()}function ze(e){var t={init:function(){ce=e.data,fe=e.source,He(),re=!1,setTimeout(function(){ae=!1},U)},reset:function(){ae?i("Page reset ignored by init"):(i("Page size reset by host page"),Ce("resetPage"))},resize:function(){A("resizeParent","Parent window requested size check")},moveToAnchor:function(){k.findTarget(a())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var s=a();i("PageInfoFromParent called from parent: "+s),G(JSON.parse(s)),i(" --")},message:function(){var s=a();i("onMessage called from parent: "+s),Q(JSON.parse(s)),i(" --")}};function n(){return q===(""+e.data).slice(0,se)}function o(){return e.data.split("]")[1].split(":")[0]}function a(){return e.data.slice(e.data.indexOf(":")+1)}function l(){return!z.exports&&"iFrameResize"in window||window.jQuery!==u&&"iFrameResize"in window.jQuery.prototype}function m(){return e.data.split(":")[2]in{true:1,false:1}}function d(){var s=o();s in t?t[s]():!l()&&!m()&&T("Unexpected message ("+e.data+")")}function c(){re===!1?d():m()?t.init():i('Ignored message of type "'+o()+'". Received before initialization.')}n()&&c()}function Re(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeResizer"in window||(window.iframeChildListener=function(e){ze({data:e})},C(window,"message",ze),C(window,"readystatechange",Re),Re())})()})(ke)),ke.exports}var Fe=at();const ct=it(Fe),st=rt({__proto__:null,default:ct},[Fe]);export{st as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as Re,L as SF,m as PF,e as qB,M as KB,N as IF,O as iC,j as $l,c as ZB,Q as ub,R as nC,y as MF,T as BF,U as Bi,V as RF,W as LF,X as df,Y as _e,Z as zc,_ as YB,$ as DF}from"./index-
|
|
1
|
+
import{r as Re,L as SF,m as PF,e as qB,M as KB,N as IF,O as iC,j as $l,c as ZB,Q as ub,R as nC,y as MF,T as BF,U as Bi,V as RF,W as LF,X as df,Y as _e,Z as zc,_ as YB,$ as DF}from"./index-BIyIgwS4.js";import{p as kF,_ as ms}from"./slicedToArray-CQ1aOJ-Q-fFO-C-TS.js";import{l as $c,p as th,b as G2,a as Ap,y as j2}from"./inherits-BwU0tCO4-DkeIG_qH.js";import{v as OF,d as QB}from"./withFullScreenWrapper-CsmVH3u1-BwamaUTy.js";import{y as FF,X as NF}from"./Toolbar-Dj6ALImb-BVamUnHI.js";import{U as zF}from"./useBasicWidgetState-DH5OpqC3-H5wMmJFo.js";import"./FormClearHelper-DcUb9gFm-uvoV81fq.js";var rC={};function UF(i,t){for(var e=0;e<t.length;e++){const n=t[e];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in i)){const o=Object.getOwnPropertyDescriptor(n,r);o&&Object.defineProperty(i,r,o.get?o:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}async function Am(i,t,e,n){return n._parse(i,t,e,n)}function vr(i,t){if(!i)throw new Error(t||"loader assertion failed.")}const Cy=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),sC=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);sC&&parseFloat(sC[1]);const oC=globalThis,aC=globalThis.process||{},VF=globalThis.navigator||{};function JB(i){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function pf(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||JB()}function GF(i){return pf()?JB()?"Electron":(VF.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const $B="4.1.0";function jF(i){try{const t=window[i],e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch{return null}}class WF{constructor(t,e,n="sessionStorage"){this.storage=jF(n),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function HF(i){let t;return i<10?t=`${i.toFixed(2)}ms`:i<100?t=`${i.toFixed(1)}ms`:i<1e3?t=`${i.toFixed(0)}ms`:t=`${(i/1e3).toFixed(2)}s`,t}function XF(i,t=8){const e=Math.max(t-i.length,0);return`${" ".repeat(e)}${i}`}var Og;(function(i){i[i.BLACK=30]="BLACK",i[i.RED=31]="RED",i[i.GREEN=32]="GREEN",i[i.YELLOW=33]="YELLOW",i[i.BLUE=34]="BLUE",i[i.MAGENTA=35]="MAGENTA",i[i.CYAN=36]="CYAN",i[i.WHITE=37]="WHITE",i[i.BRIGHT_BLACK=90]="BRIGHT_BLACK",i[i.BRIGHT_RED=91]="BRIGHT_RED",i[i.BRIGHT_GREEN=92]="BRIGHT_GREEN",i[i.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",i[i.BRIGHT_BLUE=94]="BRIGHT_BLUE",i[i.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",i[i.BRIGHT_CYAN=96]="BRIGHT_CYAN",i[i.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Og||(Og={}));const qF=10;function lC(i){return typeof i!="string"?i:(i=i.toUpperCase(),Og[i]||Og.WHITE)}function KF(i,t,e){return!pf&&typeof i=="string"&&(t&&(i=`\x1B[${lC(t)}m${i}\x1B[39m`),e&&(i=`\x1B[${lC(e)+qF}m${i}\x1B[49m`)),i}function ZF(i,t=["constructor"]){const e=Object.getPrototypeOf(i),n=Object.getOwnPropertyNames(e),r=i;for(const o of n){const s=r[o];typeof s=="function"&&(t.find(l=>o===l)||(r[o]=s.bind(i)))}}function W2(i,t){if(!i)throw new Error("Assertion failed")}function Ad(){let i;if(pf()&&oC.performance)i=oC?.performance?.now?.();else if("hrtime"in aC){const t=aC?.hrtime?.();i=t[0]*1e3+t[1]/1e6}else i=Date.now();return i}const md={debug:pf()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},YF={enabled:!0,level:0};function gd(){}const uC={},cC={once:!0};class Mp{constructor({id:t}={id:""}){this.VERSION=$B,this._startTs=Ad(),this._deltaTs=Ad(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new WF(`__probe-${this.id}__`,YF),this.timeStamp(`${this.id} started`),ZF(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ad()-this._startTs).toPrecision(10))}getDelta(){return Number((Ad()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){if(!t)throw new Error(e||"Assertion failed")}warn(t){return this._getLogFunction(0,t,md.warn,arguments,cC)}error(t){return this._getLogFunction(0,t,md.error,arguments)}deprecated(t,e){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${e}\` instead`)}removed(t,e){return this.error(`\`${t}\` has been removed. Use \`${e}\` instead`)}probe(t,e){return this._getLogFunction(t,e,md.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,md.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,md.debug||md.info,arguments,cC)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||gd,n&&[n],{tag:JF(e)}):gd}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||gd)}group(t,e,n={collapsed:!1}){const r=hC({logLevel:t,message:e,opts:n}),{collapsed:o}=n;return r.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,e,n={}){return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||gd)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=t6(t)}_getLogFunction(t,e,n,r,o){if(this._shouldLog(t)){o=hC({logLevel:t,message:e,args:r,opts:o}),n=n||o.method,W2(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Ad();const s=o.tag||o.message;if(o.once&&s)if(!uC[s])uC[s]=Ad();else return gd;return e=QF(this.id,o.message,o),n.bind(console,e,...o.args)}return gd}}Mp.VERSION=$B;function t6(i){if(!i)return 0;let t;switch(typeof i){case"number":t=i;break;case"object":t=i.logLevel||i.priority||0;break;default:return 0}return W2(Number.isFinite(t)&&t>=0),t}function hC(i){const{logLevel:t,message:e}=i;i.logLevel=t6(t);const n=i.args?Array.from(i.args):[];for(;n.length&&n.shift()!==e;);switch(typeof t){case"string":case"function":e!==void 0&&n.unshift(e),i.message=t;break;case"object":Object.assign(i,t);break}typeof i.message=="function"&&(i.message=i.message());const r=typeof i.message;return W2(r==="string"||r==="object"),Object.assign(i,{args:n},i.opts)}function QF(i,t,e){if(typeof t=="string"){const n=e.time?XF(HF(e.total)):"";t=e.time?`${i}: ${n} ${t}`:`${i}: ${t}`,t=KF(t,e.color,e.background)}return t}function JF(i){for(const t in i)for(const e in i[t])return e||"untitled";return"empty"}globalThis.probe={};const e6=new Mp({id:"@probe.gl/log"}),r_="4.3.3",$F=r_[0]>="0"&&r_[0]<="9"?`v${r_}`:"";function tN(){const i=new Mp({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=i,globalThis.loaders.version=$F,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=i,i}const eN=tN();function i6(i,t){return n6(i||{},t)}function n6(i,t,e=0){if(e>3)return t;const n={...i};for(const[r,o]of Object.entries(t))o&&typeof o=="object"&&!Array.isArray(o)?n[r]=n6(n[r]||{},t[r],e+1):n[r]=t[r];return n}function iN(i){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,i)}function nN(i){return globalThis.loaders?.modules?.[i]||null}const rN="latest";function sN(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.3"),globalThis._loadersgl_.version}const r6=sN();function Yu(i,t){if(!i)throw new Error(t||"loaders.gl assertion failed.")}const Oa=typeof process!="object"||String(process)!=="[object process]"||process.browser,H2=typeof importScripts=="function",oN=typeof window<"u"&&typeof window.orientation<"u",fC=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);fC&&parseFloat(fC[1]);class aN{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,e){this.name=t,this.workerThread=e,this.result=new Promise((n,r)=>{this._resolve=n,this._reject=r})}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){Yu(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){Yu(this.isRunning),this.isRunning=!1,this._reject(t)}}class s_{terminate(){}}const o_=new Map;function lN(i){Yu(i.source&&!i.url||!i.source&&i.url);let t=o_.get(i.source||i.url);return t||(i.url&&(t=uN(i.url),o_.set(i.url,t)),i.source&&(t=s6(i.source),o_.set(i.source,t))),Yu(t),t}function uN(i){if(!i.startsWith("http"))return i;const t=cN(i);return s6(t)}function s6(i){const t=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(t)}function cN(i){return`try {
|
|
2
2
|
importScripts('${i}');
|
|
3
3
|
} catch (error) {
|
|
4
4
|
console.error(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a$ as X,r as S,l as q,y as Q,v as P,aN as J,aM as K,j as h,c as b,aI as Y,aJ as Z,b0 as ee,aK as te,ap as _,aR as R,E as O,_ as T,w as re,m as ie,b1 as se,X as oe,ao as ae,b2 as $,b3 as ne,aS as le,aQ as de,ai as ce,aC as ue}from"./index-BxpEVUJq.js";import{t as V}from"./UploadFileInfo-B5SttewO-BfvME59S.js";import{d as he}from"./FormClearHelper-B-0AN2KG-drNJ-Zdq.js";import{q as pe,U as fe}from"./ProgressBar-DlHaaa-z-DdC3oXz0.js";var L=S.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return S.createElement(O,T({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:l}),S.createElement("rect",{width:24,height:24,fill:"none"}),S.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});L.displayName="SwitchCamera";var D=S.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return S.createElement(O,T({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{ref:l}),S.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});D.displayName="Video";var A=S.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return S.createElement(O,T({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{ref:l}),S.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});A.displayName="X";function ge(r,l){switch(r){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const H=b("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),k=b("div",{target:"etz5kuj8"})(({theme:r,width:l})=>({backgroundColor:r.colors.secondaryBg,borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),me=b("p",{target:"etz5kuj7"})(({theme:r})=>({marginTop:r.spacing.sm,textAlign:"center"}),""),ve=b("img",{target:"etz5kuj6"})(({theme:r,opacity:l})=>({borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),Se=b("a",{target:"etz5kuj5"})(({theme:r})=>({color:r.colors.link,textDecoration:r.linkUnderline?"underline":"none",display:"block"}),""),ye=b("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),we=b("div",{target:"etz5kuj3"})(({theme:r})=>({position:"absolute",top:r.spacing.lg,right:r.spacing.lg,zIndex:r.zIndices.priority,color:r.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),Me=b("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),Ue=b("button",{target:"etz5kuj0"})(({theme:r})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:r.colors.lightenedBg05,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,borderRadius:`0 0 ${r.radii.default} ${r.radii.default}`,"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:r.colors.fadedText40,borderColor:r.colors.borderColor,backgroundColor:r.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:r.fontWeights.normal,padding:`${r.spacing.xs} ${r.spacing.md}`,margin:r.spacing.none,lineHeight:r.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${ae(r.colors.primary,.5)}`},...ge("medium",r)}),"");function Ce({disabled:r,onClick:l,children:e,progress:s}){return h.jsxs(Ue,{disabled:r||!1,onClick:l||(()=>{}),progress:s||null,"data-testid":"stCameraInputButton",children:[e,s?h.jsx(Me,{children:h.jsx(pe,{value:s,size:fe.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const N=S.memo(Ce);var E=(r=>(r.USER="user",r.ENVIRONMENT="environment",r))(E||{});const xe=({switchFacingMode:r})=>h.jsx(we,{"data-testid":"stCameraInputSwitchButton",children:h.jsx(le,{content:"Switch camera",placement:_.TOP_RIGHT,children:h.jsx(de,{kind:ce.MINIMAL,onClick:r,children:h.jsx(R,{content:L,size:"twoXL",color:$.white})})})}),be=S.memo(xe);var F={exports:{}},Ie=F.exports,z;function je(){return z||(z=1,(function(r,l){(function(e,s){r.exports=s(ue)})(Ie,function(e){return(function(s){var o={};function a(n){if(o[n])return o[n].exports;var p=o[n]={i:n,l:!1,exports:{}};return s[n].call(p.exports,p,p.exports,a),p.l=!0,p.exports}return a.m=s,a.c=o,a.d=function(n,p,y){a.o(n,p)||Object.defineProperty(n,p,{enumerable:!0,get:y})},a.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},a.t=function(n,p){if(p&1&&(n=a(n)),p&8||p&4&&typeof n=="object"&&n&&n.__esModule)return n;var y=Object.create(null);if(a.r(y),Object.defineProperty(y,"default",{enumerable:!0,value:n}),p&2&&typeof n!="string")for(var x in n)a.d(y,x,(function(C){return n[C]}).bind(null,x));return y},a.n=function(n){var p=n&&n.__esModule?(function(){return n.default}):(function(){return n});return a.d(p,"a",p),p},a.o=function(n,p){return Object.prototype.hasOwnProperty.call(n,p)},a.p="",a(a.s="./src/react-webcam.tsx")})({"./src/react-webcam.tsx":(function(s,o,a){a.r(o);var n=a("react"),p=(function(){var f=function(u,i){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,c){t.__proto__=c}||function(t,c){for(var d in c)c.hasOwnProperty(d)&&(t[d]=c[d])},f(u,i)};return function(u,i){f(u,i);function t(){this.constructor=u}u.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}})(),y=function(){return y=Object.assign||function(f){for(var u,i=1,t=arguments.length;i<t;i++){u=arguments[i];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(f[c]=u[c])}return f},y.apply(this,arguments)},x=function(f,u){var i={};for(var t in f)Object.prototype.hasOwnProperty.call(f,t)&&u.indexOf(t)<0&&(i[t]=f[t]);if(f!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,t=Object.getOwnPropertySymbols(f);c<t.length;c++)u.indexOf(t[c])<0&&Object.prototype.propertyIsEnumerable.call(f,t[c])&&(i[t[c]]=f[t[c]]);return i};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(f){var u=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return u?new Promise(function(i,t){u.call(navigator,f,i,t)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function C(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=(function(f){p(u,f);function u(i){var t=f.call(this,i)||this;return t.canvas=null,t.ctx=null,t.requestUserMediaId=0,t.unmounted=!1,t.state={hasUserMedia:!1},t}return u.prototype.componentDidMount=function(){var i=this,t=i.state,c=i.props;if(this.unmounted=!1,!C()){c.onUserMediaError("getUserMedia not supported");return}t.hasUserMedia||this.requestUserMedia(),c.children&&typeof c.children!="function"&&console.warn("children must be a function")},u.prototype.componentDidUpdate=function(i){var t=this.props;if(!C()){t.onUserMediaError("getUserMedia not supported");return}var c=JSON.stringify(i.audioConstraints)!==JSON.stringify(t.audioConstraints),d=JSON.stringify(i.videoConstraints)!==JSON.stringify(t.videoConstraints),M=i.minScreenshotWidth!==t.minScreenshotWidth,v=i.minScreenshotHeight!==t.minScreenshotHeight;(d||M||v)&&(this.canvas=null,this.ctx=null),(c||d)&&(this.stopAndCleanup(),this.requestUserMedia())},u.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},u.stopMediaStream=function(i){i&&(i.getVideoTracks&&i.getAudioTracks?(i.getVideoTracks().map(function(t){i.removeTrack(t),t.stop()}),i.getAudioTracks().map(function(t){i.removeTrack(t),t.stop()})):i.stop())},u.prototype.stopAndCleanup=function(){var i=this.state;i.hasUserMedia&&(u.stopMediaStream(this.stream),i.src&&window.URL.revokeObjectURL(i.src))},u.prototype.getScreenshot=function(i){var t=this,c=t.state,d=t.props;if(!c.hasUserMedia)return null;var M=this.getCanvas(i);return M&&M.toDataURL(d.screenshotFormat,d.screenshotQuality)},u.prototype.getCanvas=function(i){var t=this,c=t.state,d=t.props;if(!this.video||!c.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var M=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var m=M/v;M=d.minScreenshotWidth||this.video.clientWidth,v=M/m,d.minScreenshotHeight&&v<d.minScreenshotHeight&&(v=d.minScreenshotHeight,M=v*m)}this.canvas=document.createElement("canvas"),this.canvas.width=i?.width||M,this.canvas.height=i?.height||v,this.ctx=this.canvas.getContext("2d")}var U=this,w=U.ctx,g=U.canvas;return w&&g&&(g.width=i?.width||g.width,g.height=i?.height||g.height,d.mirrored&&(w.translate(g.width,0),w.scale(-1,1)),w.imageSmoothingEnabled=d.imageSmoothing,w.drawImage(this.video,0,0,i?.width||g.width,i?.height||g.height),d.mirrored&&(w.scale(-1,1),w.translate(-g.width,0))),g},u.prototype.requestUserMedia=function(){var i=this,t=this.props,c=function(v,m){var U={video:typeof m<"u"?m:!0};t.audio&&(U.audio=typeof v<"u"?v:!0),i.requestUserMediaId++;var w=i.requestUserMediaId;navigator.mediaDevices.getUserMedia(U).then(function(g){i.unmounted||w!==i.requestUserMediaId?u.stopMediaStream(g):i.handleUserMedia(null,g)}).catch(function(g){i.handleUserMedia(g)})};if("mediaDevices"in navigator)c(t.audioConstraints,t.videoConstraints);else{var d=function(v){return{optional:[{sourceId:v}]}},M=function(v){var m=v.deviceId;return typeof m=="string"?m:Array.isArray(m)&&m.length>0?m[0]:typeof m=="object"&&m.ideal?m.ideal:null};MediaStreamTrack.getSources(function(v){var m=null,U=null;v.forEach(function(j){j.kind==="audio"?m=j.id:j.kind==="video"&&(U=j.id)});var w=M(t.audioConstraints);w&&(m=w);var g=M(t.videoConstraints);g&&(U=g),c(d(m),d(U))})}},u.prototype.handleUserMedia=function(i,t){var c=this.props;if(i||!t){this.setState({hasUserMedia:!1}),c.onUserMediaError(i);return}this.stream=t;try{this.video&&(this.video.srcObject=t),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(t)})}c.onUserMedia(t)},u.prototype.render=function(){var i=this,t=this,c=t.state,d=t.props,M=d.audio;d.forceScreenshotSourceSize;var v=d.disablePictureInPicture;d.onUserMedia,d.onUserMediaError,d.screenshotFormat,d.screenshotQuality,d.minScreenshotWidth,d.minScreenshotHeight,d.audioConstraints,d.videoConstraints,d.imageSmoothing;var m=d.mirrored,U=d.style,w=U===void 0?{}:U,g=d.children,j=x(d,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),W=m?y(y({},w),{transform:(w.transform||"")+" scaleX(-1)"}):w,B={getScreenshot:this.getScreenshot.bind(this)};return n.createElement(n.Fragment,null,n.createElement("video",y({autoPlay:!0,disablePictureInPicture:v,src:c.src,muted:!M,playsInline:!0,ref:function(G){i.video=G},style:W},j)),g&&g(B))},u.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},u})(n.Component);o.default=I}),react:(function(s,o){s.exports=e})}).default})})(F)),F.exports}var Pe=je();const Ee=oe(Pe),Fe=({width:r})=>h.jsxs(k,{width:r,children:[h.jsx(R,{size:"threeXL",color:$.gray60,content:D}),h.jsxs(me,{children:["This app would like to use your camera.",h.jsx(Se,{href:ne,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Re=({handleCapture:r,width:l,disabled:e,clearPhotoInProgress:s,setClearPhotoInProgress:o,facingMode:a,setFacingMode:n,testOverride:p})=>{const[y,x]=S.useState(p||"pending"),C=S.useRef(null),[I,f]=S.useState(l),u=S.useCallback(re(1e3,f),[]);S.useEffect(()=>{u(l)},[l,u]);function i(){if(C.current!==null){const c=C.current.getScreenshot();r(c)}}const t=ie();return h.jsxs(H,{"data-testid":"stCameraInputWebcamComponent",children:[y!=="success"&&!e&&!s?h.jsx(Fe,{width:I}):se()&&h.jsx(be,{switchFacingMode:n}),h.jsx(k,{"data-testid":"stCameraInputWebcamStyledBox",hidden:y!=="success"&&!e&&!s,width:I,children:!e&&h.jsx(Ee,{audio:!1,ref:C,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${t.radii.default} ${t.radii.default} 0 0`},onUserMediaError:()=>{x("error")},onUserMedia:()=>{x("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:a}})}),h.jsx(N,{onClick:i,disabled:y!=="success"||e||s,children:"Take Photo"})]})},Oe=S.memo(Re),Te=150,ke=q.getLogger("CameraInput");class Ve extends S.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new he,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState(e=>({facingMode:e.facingMode===E.USER?E.ENVIRONMENT:E.USER}))},this.handleCapture=e=>{if(e===null)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});const s=o=>new Promise(a=>setTimeout(a,o));return ze(e,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(a=>({file:o,fileUrls:a[0]}))).then(({file:o,fileUrls:a})=>this.uploadFile(a,o)).then(()=>s(Te)).then(()=>{this.setState((o,a)=>({imgSrc:e,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{ke.error(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(e=>this.deleteFile(e.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:s,widgetMgr:o,fragmentId:a}=this.props,n=o.getFileUploaderStateValue(s);Q(e,n)||o.setFileUploaderStateValue(s,e,{fromUi:!0},a)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(P(e))return;this.setState({imgSrc:null});const{widgetMgr:s,element:o,fragmentId:a}=this.props;s.setFileUploaderStateValue(o,e,{fromUi:!0},a)})},this.deleteFile=e=>{const s=this.getFile(e);P(s)||(s.status.type==="uploading"&&s.status.abortController.abort(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(s.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(s=>({files:[...s.files,e]}))},this.removeFile=e=>{this.setState(s=>({files:s.files.filter(o=>o.id!==e)}))},this.getFile=e=>this.state.files.find(s=>s.id===e),this.updateFile=(e,s)=>{this.setState(o=>({files:o.files.map(a=>a.id===e?s:a)}))},this.onUploadComplete=(e,s)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(e);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.onUploadProgress=(e,s)=>{const o=this.getFile(s);if(P(o)||o.status.type!=="uploading")return;const a=Math.round(e.loaded*100/e.total);o.status.progress!==a&&this.updateFile(s,o.setStatus({type:"uploading",abortController:o.status.abortController,progress:a}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,s)=>{const o=new AbortController,a=new V(s.name,s.size,this.nextLocalFileId(),{type:"uploading",abortController:o,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,s,n=>this.onUploadProgress(n,a.id),o.signal).then(()=>this.onUploadComplete(a.id,e)).catch(n=>{n instanceof DOMException&&n.name==="AbortError"||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:n?n.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:E.USER},{widgetMgr:e,element:s}=this.props,o=e.getFileUploaderStateValue(s);if(P(o))return l;const{uploadedFileInfo:a}=o;return P(a)||a.length===0?l:{files:a.map(n=>{const p=n.name,y=n.size,x=n.fileId,C=n.fileUrls;return new V(p,y,this.nextLocalFileId(),{type:"uploaded",fileId:x,fileUrls:C})}),imgSrc:a.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:E.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=e=>e.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:e,widgetMgr:s,fragmentId:o}=this.props;s.getFileUploaderStateValue(e)===void 0&&s.setFileUploaderStateValue(e,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:s,size:o,status:a}=e;return new J({fileId:a.fileId,fileUrls:a.fileUrls,name:s,size:o})});return new K({uploadedFileInfo:l})}render(){const{element:l,widgetMgr:e,disabled:s,width:o}=this.props;return this.formClearHelper.manageFormClearListener(e,l.formId,this.onFormCleared),h.jsxs(H,{className:"stCameraInput","data-testid":"stCameraInput",children:[h.jsx(Y,{label:l.label,disabled:s,labelVisibility:Z(l.labelVisibility?.value),children:l.help&&h.jsx(ee,{children:h.jsx(te,{content:l.help,placement:_.TOP_RIGHT})})}),this.state.imgSrc?h.jsxs(h.Fragment,{children:[h.jsx(k,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&h.jsx(ve,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:o*9/16})}),h.jsx(N,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||s,children:this.getProgress()?"Uploading...":h.jsxs(ye,{children:[h.jsx(R,{content:A,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):h.jsx(Oe,{handleCapture:this.handleCapture,width:o,disabled:s,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function ze(r,l){return fetch(r).then(e=>e.arrayBuffer()).then(e=>new File([e],l,{type:"image/jpeg"}))}const Ae=X(Ve);export{Ae as default};
|
|
1
|
+
import{a$ as X,r as S,l as q,y as Q,v as P,aN as J,aM as K,j as h,c as b,aI as Y,aJ as Z,b0 as ee,aK as te,ap as _,aR as R,E as O,_ as T,w as re,m as ie,b1 as se,X as oe,ao as ae,b2 as $,b3 as ne,aS as le,aQ as de,ai as ce,aC as ue}from"./index-BIyIgwS4.js";import{t as V}from"./UploadFileInfo-B5SttewO-BfvME59S.js";import{d as he}from"./FormClearHelper-DcUb9gFm-uvoV81fq.js";import{q as pe,U as fe}from"./ProgressBar-Q8F-JGwo-LczZQzat.js";var L=S.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return S.createElement(O,T({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:l}),S.createElement("rect",{width:24,height:24,fill:"none"}),S.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});L.displayName="SwitchCamera";var D=S.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return S.createElement(O,T({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{ref:l}),S.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});D.displayName="Video";var A=S.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return S.createElement(O,T({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{ref:l}),S.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});A.displayName="X";function ge(r,l){switch(r){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const H=b("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),k=b("div",{target:"etz5kuj8"})(({theme:r,width:l})=>({backgroundColor:r.colors.secondaryBg,borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),me=b("p",{target:"etz5kuj7"})(({theme:r})=>({marginTop:r.spacing.sm,textAlign:"center"}),""),ve=b("img",{target:"etz5kuj6"})(({theme:r,opacity:l})=>({borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),Se=b("a",{target:"etz5kuj5"})(({theme:r})=>({color:r.colors.link,textDecoration:r.linkUnderline?"underline":"none",display:"block"}),""),ye=b("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),we=b("div",{target:"etz5kuj3"})(({theme:r})=>({position:"absolute",top:r.spacing.lg,right:r.spacing.lg,zIndex:r.zIndices.priority,color:r.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),Me=b("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),Ue=b("button",{target:"etz5kuj0"})(({theme:r})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:r.colors.lightenedBg05,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,borderRadius:`0 0 ${r.radii.default} ${r.radii.default}`,"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:r.colors.fadedText40,borderColor:r.colors.borderColor,backgroundColor:r.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:r.fontWeights.normal,padding:`${r.spacing.xs} ${r.spacing.md}`,margin:r.spacing.none,lineHeight:r.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${ae(r.colors.primary,.5)}`},...ge("medium",r)}),"");function Ce({disabled:r,onClick:l,children:e,progress:s}){return h.jsxs(Ue,{disabled:r||!1,onClick:l||(()=>{}),progress:s||null,"data-testid":"stCameraInputButton",children:[e,s?h.jsx(Me,{children:h.jsx(pe,{value:s,size:fe.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const N=S.memo(Ce);var E=(r=>(r.USER="user",r.ENVIRONMENT="environment",r))(E||{});const xe=({switchFacingMode:r})=>h.jsx(we,{"data-testid":"stCameraInputSwitchButton",children:h.jsx(le,{content:"Switch camera",placement:_.TOP_RIGHT,children:h.jsx(de,{kind:ce.MINIMAL,onClick:r,children:h.jsx(R,{content:L,size:"twoXL",color:$.white})})})}),be=S.memo(xe);var F={exports:{}},Ie=F.exports,z;function je(){return z||(z=1,(function(r,l){(function(e,s){r.exports=s(ue)})(Ie,function(e){return(function(s){var o={};function a(n){if(o[n])return o[n].exports;var p=o[n]={i:n,l:!1,exports:{}};return s[n].call(p.exports,p,p.exports,a),p.l=!0,p.exports}return a.m=s,a.c=o,a.d=function(n,p,y){a.o(n,p)||Object.defineProperty(n,p,{enumerable:!0,get:y})},a.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},a.t=function(n,p){if(p&1&&(n=a(n)),p&8||p&4&&typeof n=="object"&&n&&n.__esModule)return n;var y=Object.create(null);if(a.r(y),Object.defineProperty(y,"default",{enumerable:!0,value:n}),p&2&&typeof n!="string")for(var x in n)a.d(y,x,(function(C){return n[C]}).bind(null,x));return y},a.n=function(n){var p=n&&n.__esModule?(function(){return n.default}):(function(){return n});return a.d(p,"a",p),p},a.o=function(n,p){return Object.prototype.hasOwnProperty.call(n,p)},a.p="",a(a.s="./src/react-webcam.tsx")})({"./src/react-webcam.tsx":(function(s,o,a){a.r(o);var n=a("react"),p=(function(){var f=function(u,i){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,c){t.__proto__=c}||function(t,c){for(var d in c)c.hasOwnProperty(d)&&(t[d]=c[d])},f(u,i)};return function(u,i){f(u,i);function t(){this.constructor=u}u.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}})(),y=function(){return y=Object.assign||function(f){for(var u,i=1,t=arguments.length;i<t;i++){u=arguments[i];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(f[c]=u[c])}return f},y.apply(this,arguments)},x=function(f,u){var i={};for(var t in f)Object.prototype.hasOwnProperty.call(f,t)&&u.indexOf(t)<0&&(i[t]=f[t]);if(f!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,t=Object.getOwnPropertySymbols(f);c<t.length;c++)u.indexOf(t[c])<0&&Object.prototype.propertyIsEnumerable.call(f,t[c])&&(i[t[c]]=f[t[c]]);return i};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(f){var u=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return u?new Promise(function(i,t){u.call(navigator,f,i,t)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function C(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=(function(f){p(u,f);function u(i){var t=f.call(this,i)||this;return t.canvas=null,t.ctx=null,t.requestUserMediaId=0,t.unmounted=!1,t.state={hasUserMedia:!1},t}return u.prototype.componentDidMount=function(){var i=this,t=i.state,c=i.props;if(this.unmounted=!1,!C()){c.onUserMediaError("getUserMedia not supported");return}t.hasUserMedia||this.requestUserMedia(),c.children&&typeof c.children!="function"&&console.warn("children must be a function")},u.prototype.componentDidUpdate=function(i){var t=this.props;if(!C()){t.onUserMediaError("getUserMedia not supported");return}var c=JSON.stringify(i.audioConstraints)!==JSON.stringify(t.audioConstraints),d=JSON.stringify(i.videoConstraints)!==JSON.stringify(t.videoConstraints),M=i.minScreenshotWidth!==t.minScreenshotWidth,v=i.minScreenshotHeight!==t.minScreenshotHeight;(d||M||v)&&(this.canvas=null,this.ctx=null),(c||d)&&(this.stopAndCleanup(),this.requestUserMedia())},u.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},u.stopMediaStream=function(i){i&&(i.getVideoTracks&&i.getAudioTracks?(i.getVideoTracks().map(function(t){i.removeTrack(t),t.stop()}),i.getAudioTracks().map(function(t){i.removeTrack(t),t.stop()})):i.stop())},u.prototype.stopAndCleanup=function(){var i=this.state;i.hasUserMedia&&(u.stopMediaStream(this.stream),i.src&&window.URL.revokeObjectURL(i.src))},u.prototype.getScreenshot=function(i){var t=this,c=t.state,d=t.props;if(!c.hasUserMedia)return null;var M=this.getCanvas(i);return M&&M.toDataURL(d.screenshotFormat,d.screenshotQuality)},u.prototype.getCanvas=function(i){var t=this,c=t.state,d=t.props;if(!this.video||!c.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var M=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var m=M/v;M=d.minScreenshotWidth||this.video.clientWidth,v=M/m,d.minScreenshotHeight&&v<d.minScreenshotHeight&&(v=d.minScreenshotHeight,M=v*m)}this.canvas=document.createElement("canvas"),this.canvas.width=i?.width||M,this.canvas.height=i?.height||v,this.ctx=this.canvas.getContext("2d")}var U=this,w=U.ctx,g=U.canvas;return w&&g&&(g.width=i?.width||g.width,g.height=i?.height||g.height,d.mirrored&&(w.translate(g.width,0),w.scale(-1,1)),w.imageSmoothingEnabled=d.imageSmoothing,w.drawImage(this.video,0,0,i?.width||g.width,i?.height||g.height),d.mirrored&&(w.scale(-1,1),w.translate(-g.width,0))),g},u.prototype.requestUserMedia=function(){var i=this,t=this.props,c=function(v,m){var U={video:typeof m<"u"?m:!0};t.audio&&(U.audio=typeof v<"u"?v:!0),i.requestUserMediaId++;var w=i.requestUserMediaId;navigator.mediaDevices.getUserMedia(U).then(function(g){i.unmounted||w!==i.requestUserMediaId?u.stopMediaStream(g):i.handleUserMedia(null,g)}).catch(function(g){i.handleUserMedia(g)})};if("mediaDevices"in navigator)c(t.audioConstraints,t.videoConstraints);else{var d=function(v){return{optional:[{sourceId:v}]}},M=function(v){var m=v.deviceId;return typeof m=="string"?m:Array.isArray(m)&&m.length>0?m[0]:typeof m=="object"&&m.ideal?m.ideal:null};MediaStreamTrack.getSources(function(v){var m=null,U=null;v.forEach(function(j){j.kind==="audio"?m=j.id:j.kind==="video"&&(U=j.id)});var w=M(t.audioConstraints);w&&(m=w);var g=M(t.videoConstraints);g&&(U=g),c(d(m),d(U))})}},u.prototype.handleUserMedia=function(i,t){var c=this.props;if(i||!t){this.setState({hasUserMedia:!1}),c.onUserMediaError(i);return}this.stream=t;try{this.video&&(this.video.srcObject=t),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(t)})}c.onUserMedia(t)},u.prototype.render=function(){var i=this,t=this,c=t.state,d=t.props,M=d.audio;d.forceScreenshotSourceSize;var v=d.disablePictureInPicture;d.onUserMedia,d.onUserMediaError,d.screenshotFormat,d.screenshotQuality,d.minScreenshotWidth,d.minScreenshotHeight,d.audioConstraints,d.videoConstraints,d.imageSmoothing;var m=d.mirrored,U=d.style,w=U===void 0?{}:U,g=d.children,j=x(d,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),W=m?y(y({},w),{transform:(w.transform||"")+" scaleX(-1)"}):w,B={getScreenshot:this.getScreenshot.bind(this)};return n.createElement(n.Fragment,null,n.createElement("video",y({autoPlay:!0,disablePictureInPicture:v,src:c.src,muted:!M,playsInline:!0,ref:function(G){i.video=G},style:W},j)),g&&g(B))},u.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},u})(n.Component);o.default=I}),react:(function(s,o){s.exports=e})}).default})})(F)),F.exports}var Pe=je();const Ee=oe(Pe),Fe=({width:r})=>h.jsxs(k,{width:r,children:[h.jsx(R,{size:"threeXL",color:$.gray60,content:D}),h.jsxs(me,{children:["This app would like to use your camera.",h.jsx(Se,{href:ne,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Re=({handleCapture:r,width:l,disabled:e,clearPhotoInProgress:s,setClearPhotoInProgress:o,facingMode:a,setFacingMode:n,testOverride:p})=>{const[y,x]=S.useState(p||"pending"),C=S.useRef(null),[I,f]=S.useState(l),u=S.useCallback(re(1e3,f),[]);S.useEffect(()=>{u(l)},[l,u]);function i(){if(C.current!==null){const c=C.current.getScreenshot();r(c)}}const t=ie();return h.jsxs(H,{"data-testid":"stCameraInputWebcamComponent",children:[y!=="success"&&!e&&!s?h.jsx(Fe,{width:I}):se()&&h.jsx(be,{switchFacingMode:n}),h.jsx(k,{"data-testid":"stCameraInputWebcamStyledBox",hidden:y!=="success"&&!e&&!s,width:I,children:!e&&h.jsx(Ee,{audio:!1,ref:C,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${t.radii.default} ${t.radii.default} 0 0`},onUserMediaError:()=>{x("error")},onUserMedia:()=>{x("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:a}})}),h.jsx(N,{onClick:i,disabled:y!=="success"||e||s,children:"Take Photo"})]})},Oe=S.memo(Re),Te=150,ke=q.getLogger("CameraInput");class Ve extends S.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new he,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState(e=>({facingMode:e.facingMode===E.USER?E.ENVIRONMENT:E.USER}))},this.handleCapture=e=>{if(e===null)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});const s=o=>new Promise(a=>setTimeout(a,o));return ze(e,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(a=>({file:o,fileUrls:a[0]}))).then(({file:o,fileUrls:a})=>this.uploadFile(a,o)).then(()=>s(Te)).then(()=>{this.setState((o,a)=>({imgSrc:e,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{ke.error(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(e=>this.deleteFile(e.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:s,widgetMgr:o,fragmentId:a}=this.props,n=o.getFileUploaderStateValue(s);Q(e,n)||o.setFileUploaderStateValue(s,e,{fromUi:!0},a)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(P(e))return;this.setState({imgSrc:null});const{widgetMgr:s,element:o,fragmentId:a}=this.props;s.setFileUploaderStateValue(o,e,{fromUi:!0},a)})},this.deleteFile=e=>{const s=this.getFile(e);P(s)||(s.status.type==="uploading"&&s.status.abortController.abort(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(s.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(s=>({files:[...s.files,e]}))},this.removeFile=e=>{this.setState(s=>({files:s.files.filter(o=>o.id!==e)}))},this.getFile=e=>this.state.files.find(s=>s.id===e),this.updateFile=(e,s)=>{this.setState(o=>({files:o.files.map(a=>a.id===e?s:a)}))},this.onUploadComplete=(e,s)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(e);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.onUploadProgress=(e,s)=>{const o=this.getFile(s);if(P(o)||o.status.type!=="uploading")return;const a=Math.round(e.loaded*100/e.total);o.status.progress!==a&&this.updateFile(s,o.setStatus({type:"uploading",abortController:o.status.abortController,progress:a}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,s)=>{const o=new AbortController,a=new V(s.name,s.size,this.nextLocalFileId(),{type:"uploading",abortController:o,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,s,n=>this.onUploadProgress(n,a.id),o.signal).then(()=>this.onUploadComplete(a.id,e)).catch(n=>{n instanceof DOMException&&n.name==="AbortError"||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:n?n.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:E.USER},{widgetMgr:e,element:s}=this.props,o=e.getFileUploaderStateValue(s);if(P(o))return l;const{uploadedFileInfo:a}=o;return P(a)||a.length===0?l:{files:a.map(n=>{const p=n.name,y=n.size,x=n.fileId,C=n.fileUrls;return new V(p,y,this.nextLocalFileId(),{type:"uploaded",fileId:x,fileUrls:C})}),imgSrc:a.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:E.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=e=>e.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:e,widgetMgr:s,fragmentId:o}=this.props;s.getFileUploaderStateValue(e)===void 0&&s.setFileUploaderStateValue(e,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:s,size:o,status:a}=e;return new J({fileId:a.fileId,fileUrls:a.fileUrls,name:s,size:o})});return new K({uploadedFileInfo:l})}render(){const{element:l,widgetMgr:e,disabled:s,width:o}=this.props;return this.formClearHelper.manageFormClearListener(e,l.formId,this.onFormCleared),h.jsxs(H,{className:"stCameraInput","data-testid":"stCameraInput",children:[h.jsx(Y,{label:l.label,disabled:s,labelVisibility:Z(l.labelVisibility?.value),children:l.help&&h.jsx(ee,{children:h.jsx(te,{content:l.help,placement:_.TOP_RIGHT})})}),this.state.imgSrc?h.jsxs(h.Fragment,{children:[h.jsx(k,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&h.jsx(ve,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:o*9/16})}),h.jsx(N,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||s,children:this.getProgress()?"Uploading...":h.jsxs(ye,{children:[h.jsx(R,{content:A,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):h.jsx(Oe,{handleCapture:this.handleCapture,width:o,disabled:s,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function ze(r,l){return fetch(r).then(e=>e.arrayBuffer()).then(e=>new File([e],l,{type:"image/jpeg"}))}const Ae=X(Ve);export{Ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,m as S,j as o,c as f,F as T,H as v,I as a,J as R,K as z,M as j,x as C}from"./index-
|
|
1
|
+
import{r as i,m as S,j as o,c as f,F as T,H as v,I as a,J as R,K as z,M as j,x as C}from"./index-BIyIgwS4.js";const H=f("button",{target:"elibz2u2"})(({theme:e})=>({fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,color:e.colors.fadedText60,backgroundColor:e.colors.transparent,fontFamily:"inherit",margin:e.spacing.none,border:"none",boxShadow:"none",padding:e.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:e.colors.primary}}),""),I=f("div",{target:"elibz2u1"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.lg,"> span":{marginTop:e.spacing.twoXS}}),""),B=f("div",{target:"elibz2u0"})(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,div:{display:"inline-flex"}}),"");function E(e){const t=j(e);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:e.spacing.md,width:e.sizes.toastWidth,marginTop:e.spacing.sm,borderTopLeftRadius:e.radii.default,borderTopRightRadius:e.radii.default,borderBottomLeftRadius:e.radii.default,borderBottomRightRadius:e.radii.default,paddingTop:e.spacing.lg,paddingBottom:e.spacing.lg,paddingLeft:e.spacing.twoXL,paddingRight:e.spacing.twoXL,backgroundColor:e.colors.bgColor,filter:t?"brightness(0.98)":"brightness(1.2)",color:e.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:e.colors.fadedText40,width:e.fontSizes.lg,height:e.fontSizes.lg,marginRight:`calc(-1 * ${e.spacing.lg} / 2)`,":hover":{color:e.colors.bodyText}}}}}function L(e){if(e.length>104){let t=e.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return e}function k({element:e}){const{body:t,icon:r,duration:d}=e,n=S(),c=L(t),l=t!==c,[s,b]=i.useState(!l),[m,x]=i.useState(0),h=i.useCallback(()=>{b(!s)},[s]),g=i.useMemo(()=>E(n),[n]),p=i.useMemo(()=>o.jsxs(I,{expanded:s,children:[r&&o.jsx(T,{iconValue:r,size:"xl",testid:"stToastDynamicIcon"}),o.jsxs(B,{children:[o.jsx(v,{source:s?t:c,allowHTML:!1,isToast:!0}),l&&o.jsx(H,{"data-testid":"stToastViewButton",onClick:h,children:s?"view less":"view more"})]})]}),[l,s,t,r,c,h]);i.useEffect(()=>{if(n.inSidebar)return;const w=C(d)?d===0?0:d*1e3:4e3,u=a.info(p,{overrides:{...g},autoHideDuration:w});return x(u),()=>{a.update(u,{overrides:{Body:{style:{display:"none"}}}}),a.clear(u)}},[]),i.useEffect(()=>{a.update(m,{children:p,overrides:{...g}})},[m,p,g]);const y=o.jsx(R,{kind:z.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`.\n See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return o.jsx(o.Fragment,{children:n.inSidebar&&y})}const M=i.memo(k);export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,L as p,m as u,j as a,ak as x,ap as b,c as l,F as h,H as m}from"./index-
|
|
1
|
+
import{r as c,L as p,m as u,j as a,ak as x,ap as b,c as l,F as h,H as m}from"./index-BIyIgwS4.js";const f=l("div",{target:"e11k5jya2"})({name:"b6wrti",styles:"display:flex;flex-direction:column;width:100%"}),k=l("a",{target:"e11k5jya1"})(({disabled:t,isCurrentPage:o,theme:e})=>({textDecoration:"none",width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...t?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}}),""),C=l("span",{target:"e11k5jya0"})(({disabled:t,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...t?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function j(t){const{onPageChange:o,currentPageScriptHash:e}=c.useContext(p),{colors:s}=u(),{disabled:n,element:r}=t,i=e===r.pageScriptHash,g=d=>{r.external?n&&d.preventDefault():(d.preventDefault(),n||o(r.pageScriptHash))};return a.jsx("div",{className:"stPageLink","data-testid":"stPageLink",children:a.jsx(x,{help:r.help,placement:b.TOP_RIGHT,containerWidth:!0,children:a.jsx(f,{children:a.jsxs(k,{"data-testid":"stPageLink-NavLink",disabled:n,isCurrentPage:i,href:r.page,target:r.external?"_blank":"",rel:"noreferrer",onClick:g,children:[r.icon&&a.jsx(h,{size:"lg",color:n?s.fadedText40:s.bodyText,iconValue:r.icon}),a.jsx(C,{disabled:n,children:a.jsx(m,{source:r.label,allowHTML:!1,isLabel:!0,boldLabel:i,largerLabel:!0,disableLinks:!0})})]})})})})}const y=c.memo(j);export{y as default};
|