@abtnode/webapp 1.16.30-beta-e7a90fb2 → 1.16.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{Add-nimIss-R.js → Add-B6ZIiZST.js} +1 -1
- package/dist/assets/{ArrowDropDown-SDLo8AU6.js → ArrowDropDown-CTOfLnwc.js} +1 -1
- package/dist/assets/{Autocomplete-mLMpcAAZ.js → Autocomplete-BRgMnZ52.js} +1 -1
- package/dist/assets/{Breadcrumbs-Bt0YLDiP.js → Breadcrumbs-s9U9zLgF.js} +1 -1
- package/dist/assets/{ButtonGroup-BIMC9S6K.js → ButtonGroup-3w5LvaA0.js} +1 -1
- package/dist/assets/{CheckCircle-__Xpcyhc.js → CheckCircle-DE_y9vib.js} +1 -1
- package/dist/assets/{ChevronLeft-DFREsjdS.js → ChevronLeft-CvWKad8W.js} +1 -1
- package/dist/assets/{ChevronRight-SbPIKwoC.js → ChevronRight-93HrdGCM.js} +1 -1
- package/dist/assets/{Close-BpEmkp97.js → Close-DzKkufzk.js} +1 -1
- package/dist/assets/{Delete-B-wviuP1.js → Delete-DFFe3xyW.js} +1 -1
- package/dist/assets/DeleteOutline-yYcRq6ni.js +1 -0
- package/dist/assets/{Done-DEwehpwv.js → Done-3-QQ_TOf.js} +1 -1
- package/dist/assets/{Edit-DK6KZi0P.js → Edit-wLc7o2cw.js} +1 -1
- package/dist/assets/{EditIcon-FDN14b0G.js → EditIcon-BCVTD6hP.js} +1 -1
- package/dist/assets/{ExpandMore-CoMbEsJD.js → ExpandMore-CFYbzpsT.js} +1 -1
- package/dist/assets/{FilterList-BSbt4VER.js → FilterList-FEjK2Fox.js} +1 -1
- package/dist/assets/{Google-DvvB9-RU.js → Google-C9I0SVEJ.js} +1 -1
- package/dist/assets/{Https-CHMUgx6-.js → Https-BPSFFlg6.js} +1 -1
- package/dist/assets/{InputAdornment-C_X3KhDA.js → InputAdornment-DT4h3g9o.js} +1 -1
- package/dist/assets/{InputLabel-qD-ek4kX.js → InputLabel-BOR0LpK5.js} +1 -1
- package/dist/assets/{LastPage-DRexSCl8.js → LastPage-BmNCoOR7.js} +1 -1
- package/dist/assets/{Launch-CXTnJ_ZP.js → Launch-BN3gZaS3.js} +1 -1
- package/dist/assets/{Link-BVKoqsek.js → Link-Dxx2K6Ua.js} +1 -1
- package/dist/assets/{LoadingButton-DHGZB25W.js → LoadingButton-DdNqcAhj.js} +1 -1
- package/dist/assets/{LockIcon-DGE39kAx.js → LockIcon-BB4v3xDA.js} +1 -1
- package/dist/assets/{Loop-DQi2cfGf.js → Loop-COqhNCYW.js} +1 -1
- package/dist/assets/{MoreHoriz-BXgBR7_l.js → MoreHoriz-IPlU_Vvy.js} +1 -1
- package/dist/assets/{MoreVert-xXktVXrB.js → MoreVert-C_-FQbwq.js} +1 -1
- package/dist/assets/{Pagination-DnPfWmf4.js → Pagination-BfGbGnHW.js} +1 -1
- package/dist/assets/{Public-DZG9u5nc.js → Public-CcSZDx4-.js} +1 -1
- package/dist/assets/{SchemaReference.es-DknvTEzi.js → SchemaReference.es-DmaLWYOX.js} +1 -1
- package/dist/assets/{Search-D2g_vALD.js → Search-CjX0JQkS.js} +1 -1
- package/dist/assets/{Select-DEE1eR0K.js → Select-C44-YCyD.js} +1 -1
- package/dist/assets/{Skeleton-m_lkZ6lH.js → Skeleton-4s7n7VqF.js} +1 -1
- package/dist/assets/{Slider-CBmIjsNj.js → Slider-C0JALcDq.js} +1 -1
- package/dist/assets/{Stepper-D4h3SXw3.js → Stepper-BRwbb4LL.js} +1 -1
- package/dist/assets/{TextField-Cml5LlcX.js → TextField-BjNW7Bjw.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-DdMGIkJV.js → ToggleButtonGroup-DtqIWzr-.js} +1 -1
- package/dist/assets/{ViewList-Lg33z4FS.js → ViewList-CHj6lFwi.js} +1 -1
- package/dist/assets/{actions-Rsfuoore.js → actions-DGcLEhc9.js} +1 -1
- package/dist/assets/{actions-CCw2fiQZ.js → actions-TtrKwsqz.js} +1 -1
- package/dist/assets/{agreement-C2LFpgfH.js → agreement-DXIl-xR_.js} +1 -1
- package/dist/assets/api-Rcl-3MyM.js +1 -0
- package/dist/assets/{app-avatar-Z0pI74yn.js → app-avatar-BvOjNwzf.js} +1 -1
- package/dist/assets/{audit-logs-CGjF68d3.js → audit-logs-D4-Bez8p.js} +1 -1
- package/dist/assets/blocklet-d8bc_SQ4.js +1 -0
- package/dist/assets/{brace-fold.es-D-xxO9tk.js → brace-fold.es-B1LEOxqn.js} +1 -1
- package/dist/assets/{bundle-avatar-k-apmNe0.js → bundle-avatar-CW4zHZR5.js} +1 -1
- package/dist/assets/{chart-BHydpm-Q.js → chart-TIGkq42g.js} +1 -1
- package/dist/assets/{click-to-copy--CxmqZHP.js → click-to-copy-ZbSHXJko.js} +1 -1
- package/dist/assets/{closebrackets.es-CV5tiUGf.js → closebrackets.es-hz2Jou3O.js} +1 -1
- package/dist/assets/{codemirror.es-BSwJ_jke.js → codemirror.es-DRCfXk0r.js} +1 -1
- package/dist/assets/{comment.es-CN939E1H.js → comment.es-BmnkGJwk.js} +1 -1
- package/dist/assets/{config-navigation-BKucf5SM.js → config-navigation-DS08ePOc.js} +1 -1
- package/dist/assets/{delete-confirm-DOwYzFRf.js → delete-confirm-CGv3y6py.js} +1 -1
- package/dist/assets/{detail-BBO1G3ZP.js → detail-DmU03eC7.js} +3 -3
- package/dist/assets/{dialog.es-K7-bZIzF.js → dialog.es-CSYXNrcw.js} +1 -1
- package/dist/assets/{download-D88K6-GQ.js → download-CAroNPKK.js} +1 -1
- package/dist/assets/{foldgutter.es-DPSTEVXv.js → foldgutter.es-BSRJoBoZ.js} +1 -1
- package/dist/assets/getValidReactChildren-Y-QNoefA.js +1 -0
- package/dist/assets/{hint.es-DHTbet23.js → hint.es-DuHUgHT3.js} +1 -1
- package/dist/assets/{hint.es2-DaSN5I8T.js → hint.es2-CLzxOo96.js} +1 -1
- package/dist/assets/{iframe-DjGjc5CU.js → iframe-C3LtsJmK.js} +1 -1
- package/dist/assets/index-3tln4L6C.js +21 -0
- package/dist/assets/{index-D3GDvQdK.js → index-8azRnZez.js} +1 -1
- package/dist/assets/{index-TQDBcpeB.js → index-BApbAOLy.js} +1 -1
- package/dist/assets/{index-CF-WslF6.js → index-BN-HHDJJ.js} +1 -1
- package/dist/assets/{index-Daw6hKm4.js → index-BQmNmoac.js} +1 -1
- package/dist/assets/{index-DxgXNSd2.js → index-BZCt88Kn.js} +14 -14
- package/dist/assets/{index-C1KbWOak.js → index-BatYQHX2.js} +3 -3
- package/dist/assets/{index-wB3ekx1K.js → index-BdL0EBBo.js} +1 -1
- package/dist/assets/{index-Blc0lQcO.js → index-BfvNFce6.js} +1 -1
- package/dist/assets/{index-Co3JrBLr.js → index-BrDzj3_R.js} +1 -1
- package/dist/assets/{index-D3_NSRjd.js → index-C3UQMAkF.js} +1 -1
- package/dist/assets/{index-Dx95ER6O.js → index-C3q33eZl.js} +1 -1
- package/dist/assets/{index-CBTLvRHC.js → index-C4LMPu9u.js} +1 -1
- package/dist/assets/{index-BGI6bUJP.js → index-CJBZPdm6.js} +1 -1
- package/dist/assets/{index-DKrhe0Pd.js → index-CR_2MaC1.js} +1 -1
- package/dist/assets/{index-CE0mBRzM.js → index-CUztA_gz.js} +1 -1
- package/dist/assets/{index-ZTQq6T3W.js → index-CkbP6S_A.js} +1 -1
- package/dist/assets/{index-CAo0UcQ2.js → index-Cmy0GHU-.js} +1 -1
- package/dist/assets/{index-D_qCD-1x.js → index-Ctog4pYE.js} +1 -1
- package/dist/assets/{index-6hnZjYIo.js → index-CveYHk3t.js} +1 -1
- package/dist/assets/{index-BGXvULAc.js → index-D0RT0rzU.js} +1 -1
- package/dist/assets/{index-De9X8iTH.js → index-D53ihNsv.js} +1 -1
- package/dist/assets/{index-f7aL1bUo.js → index-D6q9zEjn.js} +5 -5
- package/dist/assets/{index-Cpw6Ga8g.js → index-DQo_Dew3.js} +1 -1
- package/dist/assets/{index-cqDbkK4O.js → index-DTSardYw.js} +1 -1
- package/dist/assets/{index-AO3oCF1x.js → index-DfTYGL67.js} +3 -3
- package/dist/assets/index-DnLx-UdH.js +68 -0
- package/dist/assets/{index-CeV4jn0N.js → index-DpVeIVbC.js} +1 -1
- package/dist/assets/{index-guvEPGrM.js → index-DrdqOXJL.js} +3 -3
- package/dist/assets/{index-DBP_eUf8.js → index-DtsnjFBd.js} +1 -1
- package/dist/assets/{index-C4Q4NeqR.js → index-Dy-ye0PE.js} +1 -1
- package/dist/assets/{index-BHdqgom8.js → index-DzlR4ROA.js} +2 -2
- package/dist/assets/{index-BKhW6tEi.js → index-EKqCJff8.js} +1 -1
- package/dist/assets/{index-o8JHOBc-.js → index-RRgjvIfT.js} +1 -1
- package/dist/assets/{index-mgj182ld.js → index-RrRN76hq.js} +1 -1
- package/dist/assets/{index-Mn9Cn8cU.js → index-UbiaSDM9.js} +1 -1
- package/dist/assets/{index-BsbdXNYr.js → index-aiikLstk.js} +1 -1
- package/dist/assets/{index-CgsfYcwc.js → index-ffNDefbl.js} +1 -1
- package/dist/assets/{index-DGNm6YxS.js → index-fiBRRSS-.js} +1 -1
- package/dist/assets/{index-BPHA36fg.js → index-po1Du4Ca.js} +1 -1
- package/dist/assets/{index-Dj8gJMNb.js → index-qSHb4AGp.js} +1 -1
- package/dist/assets/{index-ChCCjycd.js → index-sw48VBzs.js} +1 -1
- package/dist/assets/{index-DBjm0dlo.js → index-vCyUMIWI.js} +1 -1
- package/dist/assets/{index-D-FCWV-1.js → index-x2vTLzR6.js} +1 -1
- package/dist/assets/{index.es-39a3Nx9Z.js → index.es-C2y5LgUg.js} +1 -1
- package/dist/assets/{index.esm-VCHOqK12.js → index.esm-DNLYWMPY.js} +1 -1
- package/dist/assets/{info-addon.es-BC4uTAVC.js → info-addon.es-OU9D4WD4.js} +1 -1
- package/dist/assets/{info.es-BOB5BDAa.js → info.es-BYpWwfiq.js} +1 -1
- package/dist/assets/{install-from-url-BlpJ_JCL.js → install-from-url-BHRJMyoo.js} +1 -1
- package/dist/assets/{invitation-B9vV54jI.js → invitation-4BcBcG3g.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-5RuRfdDZ.js → is-path-prefix-equal-QODAXh-c.js} +1 -1
- package/dist/assets/{isEqual-BMA5WXPh.js → isEqual-CFOAIOWs.js} +1 -1
- package/dist/assets/{item-BCjdddLT.js → item-DinHwjuB.js} +1 -1
- package/dist/assets/{javascript.es-CKHSRONz.js → javascript.es-BZ4hu16-.js} +1 -1
- package/dist/assets/{jump-to-line.es-BGiUhkkZ.js → jump-to-line.es-ds6uZCNW.js} +1 -1
- package/dist/assets/{jump.es-jlQKmx9y.js → jump.es-Dow2EsmT.js} +1 -1
- package/dist/assets/{line-BQ1AqKfx.js → line-Cpeu8572.js} +3 -3
- package/dist/assets/{lint.es-Ccw618G7.js → lint.es-BumMccTK.js} +1 -1
- package/dist/assets/{lint.es2-EOTuUPIZ.js → lint.es2-BzVHBAgd.js} +1 -1
- package/dist/assets/{lint.es3-DvHlvUn_.js → lint.es3-ziEStM1n.js} +1 -1
- package/dist/assets/{list-header-RtdpLA8N.js → list-header-5GKfEIKg.js} +1 -1
- package/dist/assets/{log-C240GbUG.js → log-BzeVufdm.js} +1 -1
- package/dist/assets/{lottie-DlriAay1.js → lottie-Dittdj4N.js} +1 -1
- package/dist/assets/{matchbrackets.es-C5JsbqKa.js → matchbrackets.es-DqPFoH1c.js} +1 -1
- package/dist/assets/{memory-DmcKHXq0.js → memory-CVFS6lDi.js} +1 -1
- package/dist/assets/{mode.es-mDILARJO.js → mode.es-tUbE6Sz4.js} +1 -1
- package/dist/assets/{mode.es2-BBLB98Wl.js → mode.es2-DOWb3-oK.js} +1 -1
- package/dist/assets/{mode.es3-Bp7C6PMW.js → mode.es3-BcjY2hx8.js} +1 -1
- package/dist/assets/{onlineParser.es-BoSRyIcT.js → onlineParser.es-BdeAPFTn.js} +1 -1
- package/dist/assets/{overview-_Rxbv1NB.js → overview-D7vbgmTw.js} +1 -1
- package/dist/assets/{react-DuJ5ZkKy.js → react-Dervdh0W.js} +3 -3
- package/dist/assets/{redux-B1Qumh5U.js → redux-C4Q_CSvp.js} +1 -1
- package/dist/assets/{resource-dialog-WWRI08PV.js → resource-dialog-Byph1CoJ.js} +1 -1
- package/dist/assets/{runtime-5oxnTidw.js → runtime-7TSih23R.js} +1 -1
- package/dist/assets/{schema-5ne-6Bp4.js → schema-Bq2ly-4o.js} +1 -1
- package/dist/assets/sdk-aTAcQDv-.js +1 -0
- package/dist/assets/{search.es-R2FORdVe.js → search.es-CMLj29wb.js} +1 -1
- package/dist/assets/{searchcursor.es-DO5Jf4gN.js → searchcursor.es-eHb4SABv.js} +1 -1
- package/dist/assets/service-FolPIcUS.js +1 -0
- package/dist/assets/{shorten-label-CZlXdSOl.js → shorten-label-BSQEIROA.js} +1 -1
- package/dist/assets/{show-hint.es-Bx2uNweg.js → show-hint.es-Bn3zEE4X.js} +1 -1
- package/dist/assets/{slicedToArray-Bg3ityWL.js → slicedToArray-ROu8OO6l.js} +1 -1
- package/dist/assets/{spaces-fC9EAj53.js → spaces-CKLphlMZ.js} +1 -1
- package/dist/assets/{status-BXJ91n7W.js → status-6F7XJ5dp.js} +1 -1
- package/dist/assets/{sublime.es-DHZMehLW.js → sublime.es-CYqGOBLs.js} +1 -1
- package/dist/assets/{switch-control-BuiDLx3e.js → switch-control-BxRwCbFm.js} +1 -1
- package/dist/assets/{table-icons-bAAAjGK1.js → table-icons-BXeoVsYd.js} +2 -2
- package/dist/assets/{team-QnBuJ2rq.js → team-nBwKhOsv.js} +1 -1
- package/dist/assets/{toUpper-CFRRtQH6.js → toUpper-BBB_TInl.js} +1 -1
- package/dist/assets/{traffic-CNgUOmfv.js → traffic-BgMFjNc5.js} +1 -1
- package/dist/assets/{url-evaluation-BTdmiGRO.js → url-evaluation-C7b_jErN.js} +1 -1
- package/dist/assets/{url-join-CiWL3EAW.js → url-join-LN7aIhdX.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-CMsH-TzL.js → use-blocklet-info-for-connect-did-spaces-Dw7UZ6Jz.js} +1 -1
- package/dist/assets/{useLocalStorage-D6Ii7-Uk.js → useLocalStorage-F8gidp1W.js} +1 -1
- package/dist/assets/{useThemeProps-BlrL4N8K.js → useThemeProps-CRpVKi5P.js} +1 -1
- package/dist/assets/{util-DSMcrouF.js → util-DjDIVQpP.js} +1 -1
- package/dist/assets/{wait-container-BRhHYdS-.js → wait-container-fwTsXfbb.js} +1 -1
- package/dist/assets/{withStyles-CHrv3QJu.js → withStyles-unQnV9F2.js} +1 -1
- package/dist/assets/{wrap-locale-D-OFTljj.js → wrap-locale-CCm3KObK.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/DeleteOutline-DU3a7Mie.js +0 -1
- package/dist/assets/DeleteOutline-Dy_sSwNK.js +0 -1
- package/dist/assets/api-_ETsEoGC.js +0 -1
- package/dist/assets/blocklet-D8qZlMLE.js +0 -1
- package/dist/assets/getValidReactChildren-86LVJ_ka.js +0 -1
- package/dist/assets/index-CqrpWUFf.js +0 -21
- package/dist/assets/index-DUXbXc9f.js +0 -68
- package/dist/assets/sdk-Go6IWQIY.js +0 -1
- package/dist/assets/service-VyIQYaE6.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{l as q}from"./lottie-
|
|
1
|
+
import{l as q}from"./lottie-Dittdj4N.js";import{r as D,bb as z}from"./index-DzlR4ROA.js";function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,u,c,i,b=[],f=!0,A=!1;try{if(c=(r=r.call(t)).next,e!==0)for(;!(f=(n=c.call(r)).done)&&(b.push(n.value),b.length!==e);f=!0);}catch(g){A=!0,u=g}finally{try{if(!f&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(A)throw u}}return b}}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(n){J(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function J(t,e,r){return e=ae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){if(t==null)return{};var r={},n=Object.keys(t),u,c;for(c=0;c<n.length;c++)u=n[c],!(e.indexOf(u)>=0)&&(r[u]=t[u]);return r}function x(t,e){if(t==null)return{};var r=Q(t,e),n,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(u=0;u<c.length;u++)n=c[u],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Z(t,e){return ee(t)||G(t,e)||te(t,e)||ne()}function ee(t){if(Array.isArray(t))return t}function te(t,e){if(t){if(typeof t=="string")return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}}function j(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ne(){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 re(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ae(t){var e=re(t,"string");return typeof e=="symbol"?e:String(e)}var oe=["animationData","loop","autoplay","initialSegment","onComplete","onLoopComplete","onEnterFrame","onSegmentStart","onConfigReady","onDataReady","onDataFailed","onLoadedImages","onDOMLoaded","onDestroy","lottieRef","renderer","name","assetsPath","rendererSettings"],ie=function(e,r){var n=e.animationData,u=e.loop,c=e.autoplay,i=e.initialSegment,b=e.onComplete,f=e.onLoopComplete,A=e.onEnterFrame,g=e.onSegmentStart,O=e.onConfigReady,w=e.onDataReady,h=e.onDataFailed,l=e.onLoadedImages,L=e.onDOMLoaded,S=e.onDestroy;e.lottieRef,e.renderer,e.name,e.assetsPath,e.rendererSettings;var p=x(e,oe),P=D.useState(!1),s=Z(P,2),C=s[0],_=s[1],o=D.useRef(),v=D.useRef(null),H=function(){var a;(a=o.current)===null||a===void 0||a.play()},M=function(){var a;(a=o.current)===null||a===void 0||a.stop()},F=function(){var a;(a=o.current)===null||a===void 0||a.pause()},V=function(a){var d;(d=o.current)===null||d===void 0||d.setSpeed(a)},N=function(a,d){var m;(m=o.current)===null||m===void 0||m.goToAndPlay(a,d)},B=function(a,d){var m;(m=o.current)===null||m===void 0||m.goToAndStop(a,d)},$=function(a){var d;(d=o.current)===null||d===void 0||d.setDirection(a)},k=function(a,d){var m;(m=o.current)===null||m===void 0||m.playSegments(a,d)},W=function(a){var d;(d=o.current)===null||d===void 0||d.setSubframe(a)},K=function(a){var d;return(d=o.current)===null||d===void 0?void 0:d.getDuration(a)},U=function(){var a;(a=o.current)===null||a===void 0||a.destroy(),o.current=void 0},X=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d;if(v.current){(d=o.current)===null||d===void 0||d.destroy();var m=I(I(I({},e),a),{},{container:v.current});return o.current=q.loadAnimation(m),_(!!o.current),function(){var R;(R=o.current)===null||R===void 0||R.destroy(),o.current=void 0}}};D.useEffect(function(){var y=X();return function(){return y==null?void 0:y()}},[n,u]),D.useEffect(function(){o.current&&(o.current.autoplay=!!c)},[c]),D.useEffect(function(){if(o.current){if(!i){o.current.resetSegments(!0);return}!Array.isArray(i)||!i.length||((o.current.currentRawFrame<i[0]||o.current.currentRawFrame>i[1])&&(o.current.currentRawFrame=i[0]),o.current.setSegment(i[0],i[1]))}},[i]),D.useEffect(function(){var y=[{name:"complete",handler:b},{name:"loopComplete",handler:f},{name:"enterFrame",handler:A},{name:"segmentStart",handler:g},{name:"config_ready",handler:O},{name:"data_ready",handler:w},{name:"data_failed",handler:h},{name:"loaded_images",handler:l},{name:"DOMLoaded",handler:L},{name:"destroy",handler:S}],a=y.filter(function(m){return m.handler!=null});if(a.length){var d=a.map(function(m){var R;return(R=o.current)===null||R===void 0||R.addEventListener(m.name,m.handler),function(){var T;(T=o.current)===null||T===void 0||T.removeEventListener(m.name,m.handler)}});return function(){d.forEach(function(m){return m()})}}},[b,f,A,g,O,w,h,l,L,S]);var Y=z.createElement("div",I({style:r,ref:v},p));return{View:Y,play:H,stop:M,pause:F,setSpeed:V,goToAndStop:B,goToAndPlay:N,setDirection:$,playSegments:k,setSubframe:W,getDuration:K,destroy:U,animationContainerRef:v,animationLoaded:C,animationItem:o.current}};function ue(t){var e=t.getBoundingClientRect(),r=e.top,n=e.height,u=window.innerHeight-r,c=window.innerHeight+n;return u/c}function le(t,e,r){var n=t.getBoundingClientRect(),u=n.top,c=n.left,i=n.width,b=n.height,f=(e-c)/i,A=(r-u)/b;return{x:f,y:A}}var se=function(e){var r=e.wrapperRef,n=e.animationItem,u=e.mode,c=e.actions;D.useEffect(function(){var i=r.current;if(!(!i||!n||!c.length)){n.stop();var b=function(){var g=null,O=function(){var h=ue(i),l=c.find(function(S){var p=S.visibility;return p&&h>=p[0]&&h<=p[1]});if(l){if(l.type==="seek"&&l.visibility&&l.frames.length===2){var L=l.frames[0]+Math.ceil((h-l.visibility[0])/(l.visibility[1]-l.visibility[0])*l.frames[1]);//! goToAndStop must be relative to the start of the current segment
|
|
3
3
|
n.goToAndStop(L-n.firstFrame-1,!0)}l.type==="loop"&&(g===null||g!==l.frames||n.isPaused)&&(n.playSegments(l.frames,!0),g=l.frames),l.type==="play"&&n.isPaused&&(n.resetSegments(!0),n.play()),l.type==="stop"&&n.goToAndStop(l.frames[0]-n.firstFrame-1,!0)}};return document.addEventListener("scroll",O),function(){document.removeEventListener("scroll",O)}},f=function(){var g=function(l,L){var S=l,p=L;if(S!==-1&&p!==-1){var P=le(i,S,p);S=P.x,p=P.y}var s=c.find(function(o){var v=o.position;return v&&Array.isArray(v.x)&&Array.isArray(v.y)?S>=v.x[0]&&S<=v.x[1]&&p>=v.y[0]&&p<=v.y[1]:v&&!Number.isNaN(v.x)&&!Number.isNaN(v.y)?S===v.x&&p===v.y:!1});if(s){if(s.type==="seek"&&s.position&&Array.isArray(s.position.x)&&Array.isArray(s.position.y)&&s.frames.length===2){var C=(S-s.position.x[0])/(s.position.x[1]-s.position.x[0]),_=(p-s.position.y[0])/(s.position.y[1]-s.position.y[0]);n.playSegments(s.frames,!0),n.goToAndStop(Math.ceil((C+_)/2*(s.frames[1]-s.frames[0])),!0)}s.type==="loop"&&n.playSegments(s.frames,!0),s.type==="play"&&(n.isPaused&&n.resetSegments(!1),n.playSegments(s.frames)),s.type==="stop"&&n.goToAndStop(s.frames[0],!0)}},O=function(l){g(l.clientX,l.clientY)},w=function(){g(-1,-1)};return i.addEventListener("mousemove",O),i.addEventListener("mouseout",w),function(){i.removeEventListener("mousemove",O),i.removeEventListener("mouseout",w)}};switch(u){case"scroll":return b();case"cursor":return f()}}},[u,n])},de=function(e){var r=e.actions,n=e.mode,u=e.lottieObj,c=u.animationItem,i=u.View,b=u.animationContainerRef;return se({actions:r,animationItem:c,mode:n,wrapperRef:b}),i},fe=["style","interactivity"],ve=function(e){var r,n,u,c=e.style,i=e.interactivity,b=x(e,fe),f=ie(b,c),A=f.View,g=f.play,O=f.stop,w=f.pause,h=f.setSpeed,l=f.goToAndStop,L=f.goToAndPlay,S=f.setDirection,p=f.playSegments,P=f.setSubframe,s=f.getDuration,C=f.destroy,_=f.animationContainerRef,o=f.animationLoaded,v=f.animationItem;return D.useEffect(function(){e.lottieRef&&(e.lottieRef.current={play:g,stop:O,pause:w,setSpeed:h,goToAndPlay:L,goToAndStop:l,setDirection:S,playSegments:p,setSubframe:P,getDuration:s,destroy:C,animationContainerRef:_,animationLoaded:o,animationItem:v})},[(r=e.lottieRef)===null||r===void 0?void 0:r.current]),de({lottieObj:{View:A,play:g,stop:O,pause:w,setSpeed:h,goToAndStop:l,goToAndPlay:L,setDirection:S,playSegments:p,setSubframe:P,getDuration:s,destroy:C,animationContainerRef:_,animationLoaded:o,animationItem:v},actions:(n=i==null?void 0:i.actions)!==null&&n!==void 0?n:[],mode:(u=i==null?void 0:i.mode)!==null&&u!==void 0?u:"scroll"})};export{q as LottiePlayer,ve as default,ie as useLottie,de as useLottieInteractivity};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bb as m}from"./index-BHdqgom8.js";var ce=e=>e.type==="checkbox",ie=e=>e instanceof Date,O=e=>e==null;const et=e=>typeof e=="object";var T=e=>!O(e)&&!Array.isArray(e)&&et(e)&&!ie(e),tt=e=>T(e)&&e.target?ce(e.target)?e.target.checked:e.target.value:e,At=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,rt=(e,s)=>e.has(At(s)),xt=e=>{const s=e.constructor&&e.constructor.prototype;return T(s)&&s.hasOwnProperty("isPrototypeOf")},Re=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function p(e){let s;const t=Array.isArray(e);if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Re&&(e instanceof Blob||e instanceof FileList))&&(t||T(e)))if(s=t?[]:{},!t&&!xt(e))s=e;else for(const u in e)e.hasOwnProperty(u)&&(s[u]=p(e[u]));else return e;return s}var Ae=e=>Array.isArray(e)?e.filter(Boolean):[],w=e=>e===void 0,f=(e,s,t)=>{if(!s||!T(e))return t;const u=Ae(s.split(/[,[\].]+?/)).reduce((n,a)=>O(n)?n:n[a],e);return w(u)||u===e?w(e[s])?t:e[s]:u},j=e=>typeof e=="boolean",Te=e=>/^\w*$/.test(e),st=e=>Ae(e.replace(/["|']|\]/g,"").split(/\.|\[/)),x=(e,s,t)=>{let u=-1;const n=Te(s)?[s]:st(s),a=n.length,y=a-1;for(;++u<a;){const h=n[u];let D=t;if(u!==y){const S=e[h];D=T(S)||Array.isArray(S)?S:isNaN(+n[u+1])?{}:[]}if(h==="__proto__")return;e[h]=D,e=e[h]}return e};const ve={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},W={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},z={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},mt=m.createContext(null),Le=()=>m.useContext(mt);var it=(e,s,t,u=!0)=>{const n={defaultValues:s._defaultValues};for(const a in e)Object.defineProperty(n,a,{get:()=>{const y=a;return s._proxyFormState[y]!==W.all&&(s._proxyFormState[y]=!u||W.all),t&&(t[y]=!0),e[y]}});return n},M=e=>T(e)&&!Object.keys(e).length,ut=(e,s,t,u)=>{t(e);const{name:n,...a}=e;return M(a)||Object.keys(a).length>=Object.keys(s).length||Object.keys(a).find(y=>s[y]===(!u||W.all))},oe=e=>Array.isArray(e)?e:[e],lt=(e,s,t)=>!e||!s||e===s||oe(e).some(u=>u&&(t?u===s:u.startsWith(s)||s.startsWith(u)));function Ue(e){const s=m.useRef(e);s.current=e,m.useEffect(()=>{const t=!e.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{t&&t.unsubscribe()}},[e.disabled])}function Dt(e){const s=Le(),{control:t=s.control,disabled:u,name:n,exact:a}=e||{},[y,h]=m.useState(t._formState),D=m.useRef(!0),S=m.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),_=m.useRef(n);return _.current=n,Ue({disabled:u,next:v=>D.current&<(_.current,v.name,a)&&ut(v,S.current,t._updateFormState)&&h({...t._formState,...v}),subject:t._subjects.state}),m.useEffect(()=>(D.current=!0,S.current.isValid&&t._updateValid(!0),()=>{D.current=!1}),[t]),it(y,t,S.current,!1)}var $=e=>typeof e=="string",at=(e,s,t,u,n)=>$(e)?(u&&s.watch.add(e),f(t,e,n)):Array.isArray(e)?e.map(a=>(u&&s.watch.add(a),f(t,a))):(u&&(s.watchAll=!0),t);function wt(e){const s=Le(),{control:t=s.control,name:u,defaultValue:n,disabled:a,exact:y}=e||{},h=m.useRef(u);h.current=u,Ue({disabled:a,subject:t._subjects.values,next:_=>{lt(h.current,_.name,y)&&S(p(at(h.current,t._names,_.values||t._formValues,!1,n)))}});const[D,S]=m.useState(t._getWatch(u,n));return m.useEffect(()=>t._removeUnmounted()),D}function Et(e){const s=Le(),{name:t,disabled:u,control:n=s.control,shouldUnregister:a}=e,y=rt(n._names.array,t),h=wt({control:n,name:t,defaultValue:f(n._formValues,t,f(n._defaultValues,t,e.defaultValue)),exact:!0}),D=Dt({control:n,name:t,exact:!0}),S=m.useRef(n.register(t,{...e.rules,value:h,...j(e.disabled)?{disabled:e.disabled}:{}}));return m.useEffect(()=>{const _=n._options.shouldUnregister||a,v=(N,H)=>{const L=f(n._fields,N);L&&L._f&&(L._f.mount=H)};if(v(t,!0),_){const N=p(f(n._options.defaultValues,t));x(n._defaultValues,t,N),w(f(n._formValues,t))&&x(n._formValues,t,N)}return()=>{(y?_&&!n._state.action:_)?n.unregister(t):v(t,!1)}},[t,n,y,a]),m.useEffect(()=>{f(n._fields,t)&&n._updateDisabledField({disabled:u,fields:n._fields,name:t,value:f(n._fields,t)._f.value})},[u,t,n]),{field:{name:t,value:h,...j(u)||D.disabled?{disabled:D.disabled||u}:{},onChange:m.useCallback(_=>S.current.onChange({target:{value:tt(_),name:t},type:ve.CHANGE}),[t]),onBlur:m.useCallback(()=>S.current.onBlur({target:{value:f(n._formValues,t),name:t},type:ve.BLUR}),[t,n]),ref:m.useCallback(_=>{const v=f(n._fields,t);v&&_&&(v._f.ref={focus:()=>_.focus(),select:()=>_.select(),setCustomValidity:N=>_.setCustomValidity(N),reportValidity:()=>_.reportValidity()})},[n._fields,t])},formState:D,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!f(D.errors,t)},isDirty:{enumerable:!0,get:()=>!!f(D.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!f(D.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!f(D.validatingFields,t)},error:{enumerable:!0,get:()=>f(D.errors,t)}})}}const Wt=e=>e.render(Et(e));var St=(e,s,t,u,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[u]:n||!0}}:{},Ke=e=>({isOnSubmit:!e||e===W.onSubmit,isOnBlur:e===W.onBlur,isOnChange:e===W.onChange,isOnAll:e===W.all,isOnTouch:e===W.onTouched}),Ge=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(u=>e.startsWith(u)&&/^\.\w+/.test(e.slice(u.length))));const fe=(e,s,t,u)=>{for(const n of t||Object.keys(e)){const a=f(e,n);if(a){const{_f:y,...h}=a;if(y){if(y.refs&&y.refs[0]&&s(y.refs[0],n)&&!u)break;if(y.ref&&s(y.ref,y.name)&&!u)break;fe(h,s)}else T(h)&&fe(h,s)}}};var kt=(e,s,t)=>{const u=oe(f(e,t));return x(u,"root",s[t]),x(e,t,u),e},Oe=e=>e.type==="file",X=e=>typeof e=="function",_e=e=>{if(!Re)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},he=e=>$(e),pe=e=>e.type==="radio",be=e=>e instanceof RegExp;const ze={value:!1,isValid:!1},Je={value:!0,isValid:!0};var nt=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!w(e[0].attributes.value)?w(e[0].value)||e[0].value===""?Je:{value:e[0].value,isValid:!0}:Je:ze}return ze};const Qe={isValid:!1,value:null};var ot=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Qe):Qe;function Xe(e,s,t="validate"){if(he(e)||Array.isArray(e)&&e.every(he)||j(e)&&!e)return{type:t,message:he(e)?e:"",ref:s}}var se=e=>T(e)&&!be(e)?e:{value:e,message:""},Ye=async(e,s,t,u,n)=>{const{ref:a,refs:y,required:h,maxLength:D,minLength:S,min:_,max:v,pattern:N,validate:H,name:L,valueAsNumber:xe,mount:J,disabled:Q}=e._f,V=f(s,L);if(!J||Q)return{};const K=y?y[0]:a,G=b=>{u&&K.reportValidity&&(K.setCustomValidity(j(b)?"":b||""),K.reportValidity())},k={},ee=pe(a),de=ce(a),Y=ee||de,te=(xe||Oe(a))&&w(a.value)&&w(V)||_e(a)&&a.value===""||V===""||Array.isArray(V)&&!V.length,P=St.bind(null,L,t,k),ye=(b,F,C,U=z.maxLength,q=z.minLength)=>{const I=b?F:C;k[L]={type:b?U:q,message:I,ref:a,...P(b?U:q,I)}};if(n?!Array.isArray(V)||!V.length:h&&(!Y&&(te||O(V))||j(V)&&!V||de&&!nt(y).isValid||ee&&!ot(y).isValid)){const{value:b,message:F}=he(h)?{value:!!h,message:h}:se(h);if(b&&(k[L]={type:z.required,message:F,ref:K,...P(z.required,F)},!t))return G(F),k}if(!te&&(!O(_)||!O(v))){let b,F;const C=se(v),U=se(_);if(!O(V)&&!isNaN(V)){const q=a.valueAsNumber||V&&+V;O(C.value)||(b=q>C.value),O(U.value)||(F=q<U.value)}else{const q=a.valueAsDate||new Date(V),I=ae=>new Date(new Date().toDateString()+" "+ae),ue=a.type=="time",le=a.type=="week";$(C.value)&&V&&(b=ue?I(V)>I(C.value):le?V>C.value:q>new Date(C.value)),$(U.value)&&V&&(F=ue?I(V)<I(U.value):le?V<U.value:q<new Date(U.value))}if((b||F)&&(ye(!!b,C.message,U.message,z.max,z.min),!t))return G(k[L].message),k}if((D||S)&&!te&&($(V)||n&&Array.isArray(V))){const b=se(D),F=se(S),C=!O(b.value)&&V.length>+b.value,U=!O(F.value)&&V.length<+F.value;if((C||U)&&(ye(C,b.message,F.message),!t))return G(k[L].message),k}if(N&&!te&&$(V)){const{value:b,message:F}=se(N);if(be(b)&&!V.match(b)&&(k[L]={type:z.pattern,message:F,ref:a,...P(z.pattern,F)},!t))return G(F),k}if(H){if(X(H)){const b=await H(V,s),F=Xe(b,K);if(F&&(k[L]={...F,...P(z.validate,F.message)},!t))return G(F.message),k}else if(T(H)){let b={};for(const F in H){if(!M(b)&&!t)break;const C=Xe(await H[F](V,s),K,F);C&&(b={...C,...P(F,C.message)},G(C.message),t&&(k[L]=b))}if(!M(b)&&(k[L]={ref:K,...b},!t))return k}}return G(!0),k};function Ct(e,s){const t=s.slice(0,-1).length;let u=0;for(;u<t;)e=w(e)?u++:e[s[u++]];return e}function Rt(e){for(const s in e)if(e.hasOwnProperty(s)&&!w(e[s]))return!1;return!0}function R(e,s){const t=Array.isArray(s)?s:Te(s)?[s]:st(s),u=t.length===1?e:Ct(e,t),n=t.length-1,a=t[n];return u&&delete u[a],n!==0&&(T(u)&&M(u)||Array.isArray(u)&&Rt(u))&&R(e,t.slice(0,-1)),e}var Se=()=>{let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next&&a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}},Ve=e=>O(e)||!et(e);function Z(e,s){if(Ve(e)||Ve(s))return e===s;if(ie(e)&&ie(s))return e.getTime()===s.getTime();const t=Object.keys(e),u=Object.keys(s);if(t.length!==u.length)return!1;for(const n of t){const a=e[n];if(!u.includes(n))return!1;if(n!=="ref"){const y=s[n];if(ie(a)&&ie(y)||T(a)&&T(y)||Array.isArray(a)&&Array.isArray(y)?!Z(a,y):a!==y)return!1}}return!0}var ft=e=>e.type==="select-multiple",Tt=e=>pe(e)||ce(e),ke=e=>_e(e)&&e.isConnected,ct=e=>{for(const s in e)if(X(e[s]))return!0;return!1};function Fe(e,s={}){const t=Array.isArray(e);if(T(e)||t)for(const u in e)Array.isArray(e[u])||T(e[u])&&!ct(e[u])?(s[u]=Array.isArray(e[u])?[]:{},Fe(e[u],s[u])):O(e[u])||(s[u]=!0);return s}function dt(e,s,t){const u=Array.isArray(e);if(T(e)||u)for(const n in e)Array.isArray(e[n])||T(e[n])&&!ct(e[n])?w(s)||Ve(t[n])?t[n]=Array.isArray(e[n])?Fe(e[n],[]):{...Fe(e[n])}:dt(e[n],O(s)?{}:s[n],t[n]):t[n]=!Z(e[n],s[n]);return t}var ge=(e,s)=>dt(e,s,Fe(s)),yt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:u})=>w(e)?e:s?e===""?NaN:e&&+e:t&&$(e)?new Date(e):u?u(e):e;function Ce(e){const s=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):s.disabled))return Oe(s)?s.files:pe(s)?ot(e.refs).value:ft(s)?[...s.selectedOptions].map(({value:t})=>t):ce(s)?nt(e.refs).value:yt(w(s.value)?e.ref.value:s.value,e)}var Lt=(e,s,t,u)=>{const n={};for(const a of e){const y=f(s,a);y&&x(n,a,y._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:u}},ne=e=>w(e)?e:be(e)?e.source:T(e)?be(e.value)?e.value.source:e.value:e,Ut=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ze(e,s,t){const u=f(e,t);if(u||Te(t))return{error:u,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),y=f(s,a),h=f(e,a);if(y&&!Array.isArray(y)&&t!==a)return{name:t};if(h&&h.type)return{name:a,error:h};n.pop()}return{name:t}}var Ot=(e,s,t,u,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?u.isOnBlur:n.isOnBlur)?!e:(t?u.isOnChange:n.isOnChange)?e:!0,pt=(e,s)=>!Ae(f(e,s)).length&&R(e,s);const Mt={mode:W.onSubmit,reValidateMode:W.onChange,shouldFocusError:!0};function Bt(e={}){let s={...Mt,...e},t={submitCount:0,isDirty:!1,isLoading:X(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},u={},n=T(s.defaultValues)||T(s.values)?p(s.defaultValues||s.values)||{}:{},a=s.shouldUnregister?{}:p(n),y={action:!1,mount:!1,watch:!1},h={mount:new Set,unMount:new Set,array:new Set,watch:new Set},D,S=0;const _={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:Se(),array:Se(),state:Se()},N=Ke(s.mode),H=Ke(s.reValidateMode),L=s.criteriaMode===W.all,xe=r=>i=>{clearTimeout(S),S=setTimeout(r,i)},J=async r=>{if(_.isValid||r){const i=s.resolver?M((await Y()).errors):await P(u,!0);i!==t.isValid&&v.state.next({isValid:i})}},Q=(r,i)=>{(_.isValidating||_.validatingFields)&&((r||Array.from(h.mount)).forEach(l=>{l&&(i?x(t.validatingFields,l,i):R(t.validatingFields,l))}),v.state.next({validatingFields:t.validatingFields,isValidating:!M(t.validatingFields)}))},V=(r,i=[],l,d,c=!0,o=!0)=>{if(d&&l){if(y.action=!0,o&&Array.isArray(f(u,r))){const g=l(f(u,r),d.argA,d.argB);c&&x(u,r,g)}if(o&&Array.isArray(f(t.errors,r))){const g=l(f(t.errors,r),d.argA,d.argB);c&&x(t.errors,r,g),pt(t.errors,r)}if(_.touchedFields&&o&&Array.isArray(f(t.touchedFields,r))){const g=l(f(t.touchedFields,r),d.argA,d.argB);c&&x(t.touchedFields,r,g)}_.dirtyFields&&(t.dirtyFields=ge(n,a)),v.state.next({name:r,isDirty:b(r,i),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else x(a,r,i)},K=(r,i)=>{x(t.errors,r,i),v.state.next({errors:t.errors})},G=r=>{t.errors=r,v.state.next({errors:t.errors,isValid:!1})},k=(r,i,l,d)=>{const c=f(u,r);if(c){const o=f(a,r,w(l)?f(n,r):l);w(o)||d&&d.defaultChecked||i?x(a,r,i?o:Ce(c._f)):U(r,o),y.mount&&J()}},ee=(r,i,l,d,c)=>{let o=!1,g=!1;const A={name:r},E=!!(f(u,r)&&f(u,r)._f&&f(u,r)._f.disabled);if(!l||d){_.isDirty&&(g=t.isDirty,t.isDirty=A.isDirty=b(),o=g!==A.isDirty);const B=E||Z(f(n,r),i);g=!!(!E&&f(t.dirtyFields,r)),B||E?R(t.dirtyFields,r):x(t.dirtyFields,r,!0),A.dirtyFields=t.dirtyFields,o=o||_.dirtyFields&&g!==!B}if(l){const B=f(t.touchedFields,r);B||(x(t.touchedFields,r,l),A.touchedFields=t.touchedFields,o=o||_.touchedFields&&B!==l)}return o&&c&&v.state.next(A),o?A:{}},de=(r,i,l,d)=>{const c=f(t.errors,r),o=_.isValid&&j(i)&&t.isValid!==i;if(e.delayError&&l?(D=xe(()=>K(r,l)),D(e.delayError)):(clearTimeout(S),D=null,l?x(t.errors,r,l):R(t.errors,r)),(l?!Z(c,l):c)||!M(d)||o){const g={...d,...o&&j(i)?{isValid:i}:{},errors:t.errors,name:r};t={...t,...g},v.state.next(g)}},Y=async r=>{Q(r,!0);const i=await s.resolver(a,s.context,Lt(r||h.mount,u,s.criteriaMode,s.shouldUseNativeValidation));return Q(r),i},te=async r=>{const{errors:i}=await Y(r);if(r)for(const l of r){const d=f(i,l);d?x(t.errors,l,d):R(t.errors,l)}else t.errors=i;return i},P=async(r,i,l={valid:!0})=>{for(const d in r){const c=r[d];if(c){const{_f:o,...g}=c;if(o){const A=h.array.has(o.name);Q([d],!0);const E=await Ye(c,a,L,s.shouldUseNativeValidation&&!i,A);if(Q([d]),E[o.name]&&(l.valid=!1,i))break;!i&&(f(E,o.name)?A?kt(t.errors,E,o.name):x(t.errors,o.name,E[o.name]):R(t.errors,o.name))}!M(g)&&await P(g,i,l)}}return l.valid},ye=()=>{for(const r of h.unMount){const i=f(u,r);i&&(i._f.refs?i._f.refs.every(l=>!ke(l)):!ke(i._f.ref))&&me(r)}h.unMount=new Set},b=(r,i)=>(r&&i&&x(a,r,i),!Z(Me(),n)),F=(r,i,l)=>at(r,h,{...y.mount?a:w(i)?n:$(r)?{[r]:i}:i},l,i),C=r=>Ae(f(y.mount?a:n,r,e.shouldUnregister?f(n,r,[]):[])),U=(r,i,l={})=>{const d=f(u,r);let c=i;if(d){const o=d._f;o&&(!o.disabled&&x(a,r,yt(i,o)),c=_e(o.ref)&&O(i)?"":i,ft(o.ref)?[...o.ref.options].forEach(g=>g.selected=c.includes(g.value)):o.refs?ce(o.ref)?o.refs.length>1?o.refs.forEach(g=>(!g.defaultChecked||!g.disabled)&&(g.checked=Array.isArray(c)?!!c.find(A=>A===g.value):c===g.value)):o.refs[0]&&(o.refs[0].checked=!!c):o.refs.forEach(g=>g.checked=g.value===c):Oe(o.ref)?o.ref.value="":(o.ref.value=c,o.ref.type||v.values.next({name:r,values:{...a}})))}(l.shouldDirty||l.shouldTouch)&&ee(r,c,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ae(r)},q=(r,i,l)=>{for(const d in i){const c=i[d],o=`${r}.${d}`,g=f(u,o);(h.array.has(r)||!Ve(c)||g&&!g._f)&&!ie(c)?q(o,c,l):U(o,c,l)}},I=(r,i,l={})=>{const d=f(u,r),c=h.array.has(r),o=p(i);x(a,r,o),c?(v.array.next({name:r,values:{...a}}),(_.isDirty||_.dirtyFields)&&l.shouldDirty&&v.state.next({name:r,dirtyFields:ge(n,a),isDirty:b(r,o)})):d&&!d._f&&!O(o)?q(r,o,l):U(r,o,l),Ge(r,h)&&v.state.next({...t}),v.values.next({name:y.mount?r:void 0,values:{...a}})},ue=async r=>{y.mount=!0;const i=r.target;let l=i.name,d=!0;const c=f(u,l),o=()=>i.type?Ce(c._f):tt(r),g=A=>{d=Number.isNaN(A)||A===f(a,l,A)};if(c){let A,E;const B=o(),re=r.type===ve.BLUR||r.type===ve.FOCUS_OUT,bt=!Ut(c._f)&&!s.resolver&&!f(t.errors,l)&&!c._f.deps||Ot(re,f(t.touchedFields,l),t.isSubmitted,H,N),we=Ge(l,h,re);x(a,l,B),re?(c._f.onBlur&&c._f.onBlur(r),D&&D(0)):c._f.onChange&&c._f.onChange(r);const Ee=ee(l,B,re,!1),Vt=!M(Ee)||we;if(!re&&v.values.next({name:l,type:r.type,values:{...a}}),bt)return _.isValid&&J(),Vt&&v.state.next({name:l,...we?{}:Ee});if(!re&&we&&v.state.next({...t}),s.resolver){const{errors:je}=await Y([l]);if(g(B),d){const Ft=Ze(t.errors,u,l),$e=Ze(je,u,Ft.name||l);A=$e.error,l=$e.name,E=M(je)}}else Q([l],!0),A=(await Ye(c,a,L,s.shouldUseNativeValidation))[l],Q([l]),g(B),d&&(A?E=!1:_.isValid&&(E=await P(u,!0)));d&&(c._f.deps&&ae(c._f.deps),de(l,E,A,Ee))}},le=(r,i)=>{if(f(t.errors,i)&&r.focus)return r.focus(),1},ae=async(r,i={})=>{let l,d;const c=oe(r);if(s.resolver){const o=await te(w(r)?r:c);l=M(o),d=r?!c.some(g=>f(o,g)):l}else r?(d=(await Promise.all(c.map(async o=>{const g=f(u,o);return await P(g&&g._f?{[o]:g}:g)}))).every(Boolean),!(!d&&!t.isValid)&&J()):d=l=await P(u);return v.state.next({...!$(r)||_.isValid&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),i.shouldFocus&&!d&&fe(u,le,r?c:h.mount),d},Me=r=>{const i={...y.mount?a:n};return w(r)?i:$(r)?f(i,r):r.map(l=>f(i,l))},Be=(r,i)=>({invalid:!!f((i||t).errors,r),isDirty:!!f((i||t).dirtyFields,r),error:f((i||t).errors,r),isValidating:!!f(t.validatingFields,r),isTouched:!!f((i||t).touchedFields,r)}),gt=r=>{r&&oe(r).forEach(i=>R(t.errors,i)),v.state.next({errors:r?t.errors:{}})},Pe=(r,i,l)=>{const d=(f(u,r,{_f:{}})._f||{}).ref,c=f(t.errors,r)||{},{ref:o,message:g,type:A,...E}=c;x(t.errors,r,{...E,...i,ref:d}),v.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&d&&d.focus&&d.focus()},ht=(r,i)=>X(r)?v.values.subscribe({next:l=>r(F(void 0,i),l)}):F(r,i,!0),me=(r,i={})=>{for(const l of r?oe(r):h.mount)h.mount.delete(l),h.array.delete(l),i.keepValue||(R(u,l),R(a,l)),!i.keepError&&R(t.errors,l),!i.keepDirty&&R(t.dirtyFields,l),!i.keepTouched&&R(t.touchedFields,l),!i.keepIsValidating&&R(t.validatingFields,l),!s.shouldUnregister&&!i.keepDefaultValue&&R(n,l);v.values.next({values:{...a}}),v.state.next({...t,...i.keepDirty?{isDirty:b()}:{}}),!i.keepIsValid&&J()},Ie=({disabled:r,name:i,field:l,fields:d,value:c})=>{if(j(r)&&y.mount||r){const o=r?void 0:w(c)?Ce(l?l._f:f(d,i)._f):c;x(a,i,o),ee(i,o,!1,!1,!0)}},De=(r,i={})=>{let l=f(u,r);const d=j(i.disabled);return x(u,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...i}}),h.mount.add(r),l?Ie({field:l,disabled:i.disabled,name:r,value:i.value}):k(r,!0,i.value),{...d?{disabled:i.disabled}:{},...s.progressive?{required:!!i.required,min:ne(i.min),max:ne(i.max),minLength:ne(i.minLength),maxLength:ne(i.maxLength),pattern:ne(i.pattern)}:{},name:r,onChange:ue,onBlur:ue,ref:c=>{if(c){De(r,i),l=f(u,r);const o=w(c.value)&&c.querySelectorAll&&c.querySelectorAll("input,select,textarea")[0]||c,g=Tt(o),A=l._f.refs||[];if(g?A.find(E=>E===o):o===l._f.ref)return;x(u,r,{_f:{...l._f,...g?{refs:[...A.filter(ke),o,...Array.isArray(f(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),k(r,!1,void 0,o)}else l=f(u,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||i.shouldUnregister)&&!(rt(h.array,r)&&y.action)&&h.unMount.add(r)}}},Ne=()=>s.shouldFocusError&&fe(u,le,h.mount),vt=r=>{j(r)&&(v.state.next({disabled:r}),fe(u,(i,l)=>{const d=f(u,l);d&&(i.disabled=d._f.disabled||r,Array.isArray(d._f.refs)&&d._f.refs.forEach(c=>{c.disabled=d._f.disabled||r}))},0,!1))},qe=(r,i)=>async l=>{let d;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let c=p(a);if(v.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:g}=await Y();t.errors=o,c=g}else await P(u);if(R(t.errors,"root"),M(t.errors)){v.state.next({errors:{}});try{await r(c,l)}catch(o){d=o}}else i&&await i({...t.errors},l),Ne(),setTimeout(Ne);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:M(t.errors)&&!d,submitCount:t.submitCount+1,errors:t.errors}),d)throw d},_t=(r,i={})=>{f(u,r)&&(w(i.defaultValue)?I(r,p(f(n,r))):(I(r,i.defaultValue),x(n,r,p(i.defaultValue))),i.keepTouched||R(t.touchedFields,r),i.keepDirty||(R(t.dirtyFields,r),t.isDirty=i.defaultValue?b(r,p(f(n,r))):b()),i.keepError||(R(t.errors,r),_.isValid&&J()),v.state.next({...t}))},We=(r,i={})=>{const l=r?p(r):n,d=p(l),c=M(r),o=c?n:d;if(i.keepDefaultValues||(n=l),!i.keepValues){if(i.keepDirtyValues)for(const g of h.mount)f(t.dirtyFields,g)?x(o,g,f(a,g)):I(g,f(o,g));else{if(Re&&w(r))for(const g of h.mount){const A=f(u,g);if(A&&A._f){const E=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(_e(E)){const B=E.closest("form");if(B){B.reset();break}}}}u={}}a=e.shouldUnregister?i.keepDefaultValues?p(n):{}:p(o),v.array.next({values:{...o}}),v.values.next({values:{...o}})}h={mount:i.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},y.mount=!_.isValid||!!i.keepIsValid||!!i.keepDirtyValues,y.watch=!!e.shouldUnregister,v.state.next({submitCount:i.keepSubmitCount?t.submitCount:0,isDirty:c?!1:i.keepDirty?t.isDirty:!!(i.keepDefaultValues&&!Z(r,n)),isSubmitted:i.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:c?{}:i.keepDirtyValues?i.keepDefaultValues&&a?ge(n,a):t.dirtyFields:i.keepDefaultValues&&r?ge(n,r):i.keepDirty?t.dirtyFields:{},touchedFields:i.keepTouched?t.touchedFields:{},errors:i.keepErrors?t.errors:{},isSubmitSuccessful:i.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},He=(r,i)=>We(X(r)?r(a):r,i);return{control:{register:De,unregister:me,getFieldState:Be,handleSubmit:qe,setError:Pe,_executeSchema:Y,_getWatch:F,_getDirty:b,_updateValid:J,_removeUnmounted:ye,_updateFieldArray:V,_updateDisabledField:Ie,_getFieldArray:C,_reset:We,_resetDefaultValues:()=>X(s.defaultValues)&&s.defaultValues().then(r=>{He(r,s.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:r=>{t={...t,...r}},_disableForm:vt,_subjects:v,_proxyFormState:_,_setErrors:G,get _fields(){return u},get _formValues(){return a},get _state(){return y},set _state(r){y=r},get _defaultValues(){return n},get _names(){return h},set _names(r){h=r},get _formState(){return t},set _formState(r){t=r},get _options(){return s},set _options(r){s={...s,...r}}},trigger:ae,register:De,handleSubmit:qe,watch:ht,setValue:I,getValues:Me,reset:He,resetField:_t,clearErrors:gt,unregister:me,setError:Pe,setFocus:(r,i={})=>{const l=f(u,r),d=l&&l._f;if(d){const c=d.refs?d.refs[0]:d.ref;c.focus&&(c.focus(),i.shouldSelect&&c.select())}},getFieldState:Be}}function Ht(e={}){const s=m.useRef(),t=m.useRef(),[u,n]=m.useState({isDirty:!1,isValidating:!1,isLoading:X(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:X(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...Bt(e),formState:u});const a=s.current.control;return a._options=e,Ue({subject:a._subjects.state,next:y=>{ut(y,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),m.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),m.useEffect(()=>{if(a._proxyFormState.isDirty){const y=a._getDirty();y!==u.isDirty&&a._subjects.state.next({isDirty:y})}},[a,u.isDirty]),m.useEffect(()=>{e.values&&!Z(e.values,t.current)?(a._reset(e.values,a._options.resetOptions),t.current=e.values,n(y=>({...y}))):a._resetDefaultValues()},[e.values,a]),m.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),m.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),m.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),s.current.formState=it(u,a),s.current}export{Wt as C,wt as a,Ht as u};
|
|
1
|
+
import{bb as m}from"./index-DzlR4ROA.js";var ce=e=>e.type==="checkbox",ie=e=>e instanceof Date,O=e=>e==null;const et=e=>typeof e=="object";var T=e=>!O(e)&&!Array.isArray(e)&&et(e)&&!ie(e),tt=e=>T(e)&&e.target?ce(e.target)?e.target.checked:e.target.value:e,At=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,rt=(e,s)=>e.has(At(s)),xt=e=>{const s=e.constructor&&e.constructor.prototype;return T(s)&&s.hasOwnProperty("isPrototypeOf")},Re=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function p(e){let s;const t=Array.isArray(e);if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Re&&(e instanceof Blob||e instanceof FileList))&&(t||T(e)))if(s=t?[]:{},!t&&!xt(e))s=e;else for(const u in e)e.hasOwnProperty(u)&&(s[u]=p(e[u]));else return e;return s}var Ae=e=>Array.isArray(e)?e.filter(Boolean):[],w=e=>e===void 0,f=(e,s,t)=>{if(!s||!T(e))return t;const u=Ae(s.split(/[,[\].]+?/)).reduce((n,a)=>O(n)?n:n[a],e);return w(u)||u===e?w(e[s])?t:e[s]:u},j=e=>typeof e=="boolean",Te=e=>/^\w*$/.test(e),st=e=>Ae(e.replace(/["|']|\]/g,"").split(/\.|\[/)),x=(e,s,t)=>{let u=-1;const n=Te(s)?[s]:st(s),a=n.length,y=a-1;for(;++u<a;){const h=n[u];let D=t;if(u!==y){const S=e[h];D=T(S)||Array.isArray(S)?S:isNaN(+n[u+1])?{}:[]}if(h==="__proto__")return;e[h]=D,e=e[h]}return e};const ve={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},W={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},z={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},mt=m.createContext(null),Le=()=>m.useContext(mt);var it=(e,s,t,u=!0)=>{const n={defaultValues:s._defaultValues};for(const a in e)Object.defineProperty(n,a,{get:()=>{const y=a;return s._proxyFormState[y]!==W.all&&(s._proxyFormState[y]=!u||W.all),t&&(t[y]=!0),e[y]}});return n},M=e=>T(e)&&!Object.keys(e).length,ut=(e,s,t,u)=>{t(e);const{name:n,...a}=e;return M(a)||Object.keys(a).length>=Object.keys(s).length||Object.keys(a).find(y=>s[y]===(!u||W.all))},oe=e=>Array.isArray(e)?e:[e],lt=(e,s,t)=>!e||!s||e===s||oe(e).some(u=>u&&(t?u===s:u.startsWith(s)||s.startsWith(u)));function Ue(e){const s=m.useRef(e);s.current=e,m.useEffect(()=>{const t=!e.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{t&&t.unsubscribe()}},[e.disabled])}function Dt(e){const s=Le(),{control:t=s.control,disabled:u,name:n,exact:a}=e||{},[y,h]=m.useState(t._formState),D=m.useRef(!0),S=m.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),_=m.useRef(n);return _.current=n,Ue({disabled:u,next:v=>D.current&<(_.current,v.name,a)&&ut(v,S.current,t._updateFormState)&&h({...t._formState,...v}),subject:t._subjects.state}),m.useEffect(()=>(D.current=!0,S.current.isValid&&t._updateValid(!0),()=>{D.current=!1}),[t]),it(y,t,S.current,!1)}var $=e=>typeof e=="string",at=(e,s,t,u,n)=>$(e)?(u&&s.watch.add(e),f(t,e,n)):Array.isArray(e)?e.map(a=>(u&&s.watch.add(a),f(t,a))):(u&&(s.watchAll=!0),t);function wt(e){const s=Le(),{control:t=s.control,name:u,defaultValue:n,disabled:a,exact:y}=e||{},h=m.useRef(u);h.current=u,Ue({disabled:a,subject:t._subjects.values,next:_=>{lt(h.current,_.name,y)&&S(p(at(h.current,t._names,_.values||t._formValues,!1,n)))}});const[D,S]=m.useState(t._getWatch(u,n));return m.useEffect(()=>t._removeUnmounted()),D}function Et(e){const s=Le(),{name:t,disabled:u,control:n=s.control,shouldUnregister:a}=e,y=rt(n._names.array,t),h=wt({control:n,name:t,defaultValue:f(n._formValues,t,f(n._defaultValues,t,e.defaultValue)),exact:!0}),D=Dt({control:n,name:t,exact:!0}),S=m.useRef(n.register(t,{...e.rules,value:h,...j(e.disabled)?{disabled:e.disabled}:{}}));return m.useEffect(()=>{const _=n._options.shouldUnregister||a,v=(N,H)=>{const L=f(n._fields,N);L&&L._f&&(L._f.mount=H)};if(v(t,!0),_){const N=p(f(n._options.defaultValues,t));x(n._defaultValues,t,N),w(f(n._formValues,t))&&x(n._formValues,t,N)}return()=>{(y?_&&!n._state.action:_)?n.unregister(t):v(t,!1)}},[t,n,y,a]),m.useEffect(()=>{f(n._fields,t)&&n._updateDisabledField({disabled:u,fields:n._fields,name:t,value:f(n._fields,t)._f.value})},[u,t,n]),{field:{name:t,value:h,...j(u)||D.disabled?{disabled:D.disabled||u}:{},onChange:m.useCallback(_=>S.current.onChange({target:{value:tt(_),name:t},type:ve.CHANGE}),[t]),onBlur:m.useCallback(()=>S.current.onBlur({target:{value:f(n._formValues,t),name:t},type:ve.BLUR}),[t,n]),ref:m.useCallback(_=>{const v=f(n._fields,t);v&&_&&(v._f.ref={focus:()=>_.focus(),select:()=>_.select(),setCustomValidity:N=>_.setCustomValidity(N),reportValidity:()=>_.reportValidity()})},[n._fields,t])},formState:D,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!f(D.errors,t)},isDirty:{enumerable:!0,get:()=>!!f(D.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!f(D.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!f(D.validatingFields,t)},error:{enumerable:!0,get:()=>f(D.errors,t)}})}}const Wt=e=>e.render(Et(e));var St=(e,s,t,u,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[u]:n||!0}}:{},Ke=e=>({isOnSubmit:!e||e===W.onSubmit,isOnBlur:e===W.onBlur,isOnChange:e===W.onChange,isOnAll:e===W.all,isOnTouch:e===W.onTouched}),Ge=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(u=>e.startsWith(u)&&/^\.\w+/.test(e.slice(u.length))));const fe=(e,s,t,u)=>{for(const n of t||Object.keys(e)){const a=f(e,n);if(a){const{_f:y,...h}=a;if(y){if(y.refs&&y.refs[0]&&s(y.refs[0],n)&&!u)break;if(y.ref&&s(y.ref,y.name)&&!u)break;fe(h,s)}else T(h)&&fe(h,s)}}};var kt=(e,s,t)=>{const u=oe(f(e,t));return x(u,"root",s[t]),x(e,t,u),e},Oe=e=>e.type==="file",X=e=>typeof e=="function",_e=e=>{if(!Re)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},he=e=>$(e),pe=e=>e.type==="radio",be=e=>e instanceof RegExp;const ze={value:!1,isValid:!1},Je={value:!0,isValid:!0};var nt=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!w(e[0].attributes.value)?w(e[0].value)||e[0].value===""?Je:{value:e[0].value,isValid:!0}:Je:ze}return ze};const Qe={isValid:!1,value:null};var ot=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Qe):Qe;function Xe(e,s,t="validate"){if(he(e)||Array.isArray(e)&&e.every(he)||j(e)&&!e)return{type:t,message:he(e)?e:"",ref:s}}var se=e=>T(e)&&!be(e)?e:{value:e,message:""},Ye=async(e,s,t,u,n)=>{const{ref:a,refs:y,required:h,maxLength:D,minLength:S,min:_,max:v,pattern:N,validate:H,name:L,valueAsNumber:xe,mount:J,disabled:Q}=e._f,V=f(s,L);if(!J||Q)return{};const K=y?y[0]:a,G=b=>{u&&K.reportValidity&&(K.setCustomValidity(j(b)?"":b||""),K.reportValidity())},k={},ee=pe(a),de=ce(a),Y=ee||de,te=(xe||Oe(a))&&w(a.value)&&w(V)||_e(a)&&a.value===""||V===""||Array.isArray(V)&&!V.length,P=St.bind(null,L,t,k),ye=(b,F,C,U=z.maxLength,q=z.minLength)=>{const I=b?F:C;k[L]={type:b?U:q,message:I,ref:a,...P(b?U:q,I)}};if(n?!Array.isArray(V)||!V.length:h&&(!Y&&(te||O(V))||j(V)&&!V||de&&!nt(y).isValid||ee&&!ot(y).isValid)){const{value:b,message:F}=he(h)?{value:!!h,message:h}:se(h);if(b&&(k[L]={type:z.required,message:F,ref:K,...P(z.required,F)},!t))return G(F),k}if(!te&&(!O(_)||!O(v))){let b,F;const C=se(v),U=se(_);if(!O(V)&&!isNaN(V)){const q=a.valueAsNumber||V&&+V;O(C.value)||(b=q>C.value),O(U.value)||(F=q<U.value)}else{const q=a.valueAsDate||new Date(V),I=ae=>new Date(new Date().toDateString()+" "+ae),ue=a.type=="time",le=a.type=="week";$(C.value)&&V&&(b=ue?I(V)>I(C.value):le?V>C.value:q>new Date(C.value)),$(U.value)&&V&&(F=ue?I(V)<I(U.value):le?V<U.value:q<new Date(U.value))}if((b||F)&&(ye(!!b,C.message,U.message,z.max,z.min),!t))return G(k[L].message),k}if((D||S)&&!te&&($(V)||n&&Array.isArray(V))){const b=se(D),F=se(S),C=!O(b.value)&&V.length>+b.value,U=!O(F.value)&&V.length<+F.value;if((C||U)&&(ye(C,b.message,F.message),!t))return G(k[L].message),k}if(N&&!te&&$(V)){const{value:b,message:F}=se(N);if(be(b)&&!V.match(b)&&(k[L]={type:z.pattern,message:F,ref:a,...P(z.pattern,F)},!t))return G(F),k}if(H){if(X(H)){const b=await H(V,s),F=Xe(b,K);if(F&&(k[L]={...F,...P(z.validate,F.message)},!t))return G(F.message),k}else if(T(H)){let b={};for(const F in H){if(!M(b)&&!t)break;const C=Xe(await H[F](V,s),K,F);C&&(b={...C,...P(F,C.message)},G(C.message),t&&(k[L]=b))}if(!M(b)&&(k[L]={ref:K,...b},!t))return k}}return G(!0),k};function Ct(e,s){const t=s.slice(0,-1).length;let u=0;for(;u<t;)e=w(e)?u++:e[s[u++]];return e}function Rt(e){for(const s in e)if(e.hasOwnProperty(s)&&!w(e[s]))return!1;return!0}function R(e,s){const t=Array.isArray(s)?s:Te(s)?[s]:st(s),u=t.length===1?e:Ct(e,t),n=t.length-1,a=t[n];return u&&delete u[a],n!==0&&(T(u)&&M(u)||Array.isArray(u)&&Rt(u))&&R(e,t.slice(0,-1)),e}var Se=()=>{let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next&&a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}},Ve=e=>O(e)||!et(e);function Z(e,s){if(Ve(e)||Ve(s))return e===s;if(ie(e)&&ie(s))return e.getTime()===s.getTime();const t=Object.keys(e),u=Object.keys(s);if(t.length!==u.length)return!1;for(const n of t){const a=e[n];if(!u.includes(n))return!1;if(n!=="ref"){const y=s[n];if(ie(a)&&ie(y)||T(a)&&T(y)||Array.isArray(a)&&Array.isArray(y)?!Z(a,y):a!==y)return!1}}return!0}var ft=e=>e.type==="select-multiple",Tt=e=>pe(e)||ce(e),ke=e=>_e(e)&&e.isConnected,ct=e=>{for(const s in e)if(X(e[s]))return!0;return!1};function Fe(e,s={}){const t=Array.isArray(e);if(T(e)||t)for(const u in e)Array.isArray(e[u])||T(e[u])&&!ct(e[u])?(s[u]=Array.isArray(e[u])?[]:{},Fe(e[u],s[u])):O(e[u])||(s[u]=!0);return s}function dt(e,s,t){const u=Array.isArray(e);if(T(e)||u)for(const n in e)Array.isArray(e[n])||T(e[n])&&!ct(e[n])?w(s)||Ve(t[n])?t[n]=Array.isArray(e[n])?Fe(e[n],[]):{...Fe(e[n])}:dt(e[n],O(s)?{}:s[n],t[n]):t[n]=!Z(e[n],s[n]);return t}var ge=(e,s)=>dt(e,s,Fe(s)),yt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:u})=>w(e)?e:s?e===""?NaN:e&&+e:t&&$(e)?new Date(e):u?u(e):e;function Ce(e){const s=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):s.disabled))return Oe(s)?s.files:pe(s)?ot(e.refs).value:ft(s)?[...s.selectedOptions].map(({value:t})=>t):ce(s)?nt(e.refs).value:yt(w(s.value)?e.ref.value:s.value,e)}var Lt=(e,s,t,u)=>{const n={};for(const a of e){const y=f(s,a);y&&x(n,a,y._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:u}},ne=e=>w(e)?e:be(e)?e.source:T(e)?be(e.value)?e.value.source:e.value:e,Ut=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ze(e,s,t){const u=f(e,t);if(u||Te(t))return{error:u,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),y=f(s,a),h=f(e,a);if(y&&!Array.isArray(y)&&t!==a)return{name:t};if(h&&h.type)return{name:a,error:h};n.pop()}return{name:t}}var Ot=(e,s,t,u,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?u.isOnBlur:n.isOnBlur)?!e:(t?u.isOnChange:n.isOnChange)?e:!0,pt=(e,s)=>!Ae(f(e,s)).length&&R(e,s);const Mt={mode:W.onSubmit,reValidateMode:W.onChange,shouldFocusError:!0};function Bt(e={}){let s={...Mt,...e},t={submitCount:0,isDirty:!1,isLoading:X(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},u={},n=T(s.defaultValues)||T(s.values)?p(s.defaultValues||s.values)||{}:{},a=s.shouldUnregister?{}:p(n),y={action:!1,mount:!1,watch:!1},h={mount:new Set,unMount:new Set,array:new Set,watch:new Set},D,S=0;const _={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:Se(),array:Se(),state:Se()},N=Ke(s.mode),H=Ke(s.reValidateMode),L=s.criteriaMode===W.all,xe=r=>i=>{clearTimeout(S),S=setTimeout(r,i)},J=async r=>{if(_.isValid||r){const i=s.resolver?M((await Y()).errors):await P(u,!0);i!==t.isValid&&v.state.next({isValid:i})}},Q=(r,i)=>{(_.isValidating||_.validatingFields)&&((r||Array.from(h.mount)).forEach(l=>{l&&(i?x(t.validatingFields,l,i):R(t.validatingFields,l))}),v.state.next({validatingFields:t.validatingFields,isValidating:!M(t.validatingFields)}))},V=(r,i=[],l,d,c=!0,o=!0)=>{if(d&&l){if(y.action=!0,o&&Array.isArray(f(u,r))){const g=l(f(u,r),d.argA,d.argB);c&&x(u,r,g)}if(o&&Array.isArray(f(t.errors,r))){const g=l(f(t.errors,r),d.argA,d.argB);c&&x(t.errors,r,g),pt(t.errors,r)}if(_.touchedFields&&o&&Array.isArray(f(t.touchedFields,r))){const g=l(f(t.touchedFields,r),d.argA,d.argB);c&&x(t.touchedFields,r,g)}_.dirtyFields&&(t.dirtyFields=ge(n,a)),v.state.next({name:r,isDirty:b(r,i),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else x(a,r,i)},K=(r,i)=>{x(t.errors,r,i),v.state.next({errors:t.errors})},G=r=>{t.errors=r,v.state.next({errors:t.errors,isValid:!1})},k=(r,i,l,d)=>{const c=f(u,r);if(c){const o=f(a,r,w(l)?f(n,r):l);w(o)||d&&d.defaultChecked||i?x(a,r,i?o:Ce(c._f)):U(r,o),y.mount&&J()}},ee=(r,i,l,d,c)=>{let o=!1,g=!1;const A={name:r},E=!!(f(u,r)&&f(u,r)._f&&f(u,r)._f.disabled);if(!l||d){_.isDirty&&(g=t.isDirty,t.isDirty=A.isDirty=b(),o=g!==A.isDirty);const B=E||Z(f(n,r),i);g=!!(!E&&f(t.dirtyFields,r)),B||E?R(t.dirtyFields,r):x(t.dirtyFields,r,!0),A.dirtyFields=t.dirtyFields,o=o||_.dirtyFields&&g!==!B}if(l){const B=f(t.touchedFields,r);B||(x(t.touchedFields,r,l),A.touchedFields=t.touchedFields,o=o||_.touchedFields&&B!==l)}return o&&c&&v.state.next(A),o?A:{}},de=(r,i,l,d)=>{const c=f(t.errors,r),o=_.isValid&&j(i)&&t.isValid!==i;if(e.delayError&&l?(D=xe(()=>K(r,l)),D(e.delayError)):(clearTimeout(S),D=null,l?x(t.errors,r,l):R(t.errors,r)),(l?!Z(c,l):c)||!M(d)||o){const g={...d,...o&&j(i)?{isValid:i}:{},errors:t.errors,name:r};t={...t,...g},v.state.next(g)}},Y=async r=>{Q(r,!0);const i=await s.resolver(a,s.context,Lt(r||h.mount,u,s.criteriaMode,s.shouldUseNativeValidation));return Q(r),i},te=async r=>{const{errors:i}=await Y(r);if(r)for(const l of r){const d=f(i,l);d?x(t.errors,l,d):R(t.errors,l)}else t.errors=i;return i},P=async(r,i,l={valid:!0})=>{for(const d in r){const c=r[d];if(c){const{_f:o,...g}=c;if(o){const A=h.array.has(o.name);Q([d],!0);const E=await Ye(c,a,L,s.shouldUseNativeValidation&&!i,A);if(Q([d]),E[o.name]&&(l.valid=!1,i))break;!i&&(f(E,o.name)?A?kt(t.errors,E,o.name):x(t.errors,o.name,E[o.name]):R(t.errors,o.name))}!M(g)&&await P(g,i,l)}}return l.valid},ye=()=>{for(const r of h.unMount){const i=f(u,r);i&&(i._f.refs?i._f.refs.every(l=>!ke(l)):!ke(i._f.ref))&&me(r)}h.unMount=new Set},b=(r,i)=>(r&&i&&x(a,r,i),!Z(Me(),n)),F=(r,i,l)=>at(r,h,{...y.mount?a:w(i)?n:$(r)?{[r]:i}:i},l,i),C=r=>Ae(f(y.mount?a:n,r,e.shouldUnregister?f(n,r,[]):[])),U=(r,i,l={})=>{const d=f(u,r);let c=i;if(d){const o=d._f;o&&(!o.disabled&&x(a,r,yt(i,o)),c=_e(o.ref)&&O(i)?"":i,ft(o.ref)?[...o.ref.options].forEach(g=>g.selected=c.includes(g.value)):o.refs?ce(o.ref)?o.refs.length>1?o.refs.forEach(g=>(!g.defaultChecked||!g.disabled)&&(g.checked=Array.isArray(c)?!!c.find(A=>A===g.value):c===g.value)):o.refs[0]&&(o.refs[0].checked=!!c):o.refs.forEach(g=>g.checked=g.value===c):Oe(o.ref)?o.ref.value="":(o.ref.value=c,o.ref.type||v.values.next({name:r,values:{...a}})))}(l.shouldDirty||l.shouldTouch)&&ee(r,c,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ae(r)},q=(r,i,l)=>{for(const d in i){const c=i[d],o=`${r}.${d}`,g=f(u,o);(h.array.has(r)||!Ve(c)||g&&!g._f)&&!ie(c)?q(o,c,l):U(o,c,l)}},I=(r,i,l={})=>{const d=f(u,r),c=h.array.has(r),o=p(i);x(a,r,o),c?(v.array.next({name:r,values:{...a}}),(_.isDirty||_.dirtyFields)&&l.shouldDirty&&v.state.next({name:r,dirtyFields:ge(n,a),isDirty:b(r,o)})):d&&!d._f&&!O(o)?q(r,o,l):U(r,o,l),Ge(r,h)&&v.state.next({...t}),v.values.next({name:y.mount?r:void 0,values:{...a}})},ue=async r=>{y.mount=!0;const i=r.target;let l=i.name,d=!0;const c=f(u,l),o=()=>i.type?Ce(c._f):tt(r),g=A=>{d=Number.isNaN(A)||A===f(a,l,A)};if(c){let A,E;const B=o(),re=r.type===ve.BLUR||r.type===ve.FOCUS_OUT,bt=!Ut(c._f)&&!s.resolver&&!f(t.errors,l)&&!c._f.deps||Ot(re,f(t.touchedFields,l),t.isSubmitted,H,N),we=Ge(l,h,re);x(a,l,B),re?(c._f.onBlur&&c._f.onBlur(r),D&&D(0)):c._f.onChange&&c._f.onChange(r);const Ee=ee(l,B,re,!1),Vt=!M(Ee)||we;if(!re&&v.values.next({name:l,type:r.type,values:{...a}}),bt)return _.isValid&&J(),Vt&&v.state.next({name:l,...we?{}:Ee});if(!re&&we&&v.state.next({...t}),s.resolver){const{errors:je}=await Y([l]);if(g(B),d){const Ft=Ze(t.errors,u,l),$e=Ze(je,u,Ft.name||l);A=$e.error,l=$e.name,E=M(je)}}else Q([l],!0),A=(await Ye(c,a,L,s.shouldUseNativeValidation))[l],Q([l]),g(B),d&&(A?E=!1:_.isValid&&(E=await P(u,!0)));d&&(c._f.deps&&ae(c._f.deps),de(l,E,A,Ee))}},le=(r,i)=>{if(f(t.errors,i)&&r.focus)return r.focus(),1},ae=async(r,i={})=>{let l,d;const c=oe(r);if(s.resolver){const o=await te(w(r)?r:c);l=M(o),d=r?!c.some(g=>f(o,g)):l}else r?(d=(await Promise.all(c.map(async o=>{const g=f(u,o);return await P(g&&g._f?{[o]:g}:g)}))).every(Boolean),!(!d&&!t.isValid)&&J()):d=l=await P(u);return v.state.next({...!$(r)||_.isValid&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),i.shouldFocus&&!d&&fe(u,le,r?c:h.mount),d},Me=r=>{const i={...y.mount?a:n};return w(r)?i:$(r)?f(i,r):r.map(l=>f(i,l))},Be=(r,i)=>({invalid:!!f((i||t).errors,r),isDirty:!!f((i||t).dirtyFields,r),error:f((i||t).errors,r),isValidating:!!f(t.validatingFields,r),isTouched:!!f((i||t).touchedFields,r)}),gt=r=>{r&&oe(r).forEach(i=>R(t.errors,i)),v.state.next({errors:r?t.errors:{}})},Pe=(r,i,l)=>{const d=(f(u,r,{_f:{}})._f||{}).ref,c=f(t.errors,r)||{},{ref:o,message:g,type:A,...E}=c;x(t.errors,r,{...E,...i,ref:d}),v.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&d&&d.focus&&d.focus()},ht=(r,i)=>X(r)?v.values.subscribe({next:l=>r(F(void 0,i),l)}):F(r,i,!0),me=(r,i={})=>{for(const l of r?oe(r):h.mount)h.mount.delete(l),h.array.delete(l),i.keepValue||(R(u,l),R(a,l)),!i.keepError&&R(t.errors,l),!i.keepDirty&&R(t.dirtyFields,l),!i.keepTouched&&R(t.touchedFields,l),!i.keepIsValidating&&R(t.validatingFields,l),!s.shouldUnregister&&!i.keepDefaultValue&&R(n,l);v.values.next({values:{...a}}),v.state.next({...t,...i.keepDirty?{isDirty:b()}:{}}),!i.keepIsValid&&J()},Ie=({disabled:r,name:i,field:l,fields:d,value:c})=>{if(j(r)&&y.mount||r){const o=r?void 0:w(c)?Ce(l?l._f:f(d,i)._f):c;x(a,i,o),ee(i,o,!1,!1,!0)}},De=(r,i={})=>{let l=f(u,r);const d=j(i.disabled);return x(u,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...i}}),h.mount.add(r),l?Ie({field:l,disabled:i.disabled,name:r,value:i.value}):k(r,!0,i.value),{...d?{disabled:i.disabled}:{},...s.progressive?{required:!!i.required,min:ne(i.min),max:ne(i.max),minLength:ne(i.minLength),maxLength:ne(i.maxLength),pattern:ne(i.pattern)}:{},name:r,onChange:ue,onBlur:ue,ref:c=>{if(c){De(r,i),l=f(u,r);const o=w(c.value)&&c.querySelectorAll&&c.querySelectorAll("input,select,textarea")[0]||c,g=Tt(o),A=l._f.refs||[];if(g?A.find(E=>E===o):o===l._f.ref)return;x(u,r,{_f:{...l._f,...g?{refs:[...A.filter(ke),o,...Array.isArray(f(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),k(r,!1,void 0,o)}else l=f(u,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||i.shouldUnregister)&&!(rt(h.array,r)&&y.action)&&h.unMount.add(r)}}},Ne=()=>s.shouldFocusError&&fe(u,le,h.mount),vt=r=>{j(r)&&(v.state.next({disabled:r}),fe(u,(i,l)=>{const d=f(u,l);d&&(i.disabled=d._f.disabled||r,Array.isArray(d._f.refs)&&d._f.refs.forEach(c=>{c.disabled=d._f.disabled||r}))},0,!1))},qe=(r,i)=>async l=>{let d;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let c=p(a);if(v.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:g}=await Y();t.errors=o,c=g}else await P(u);if(R(t.errors,"root"),M(t.errors)){v.state.next({errors:{}});try{await r(c,l)}catch(o){d=o}}else i&&await i({...t.errors},l),Ne(),setTimeout(Ne);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:M(t.errors)&&!d,submitCount:t.submitCount+1,errors:t.errors}),d)throw d},_t=(r,i={})=>{f(u,r)&&(w(i.defaultValue)?I(r,p(f(n,r))):(I(r,i.defaultValue),x(n,r,p(i.defaultValue))),i.keepTouched||R(t.touchedFields,r),i.keepDirty||(R(t.dirtyFields,r),t.isDirty=i.defaultValue?b(r,p(f(n,r))):b()),i.keepError||(R(t.errors,r),_.isValid&&J()),v.state.next({...t}))},We=(r,i={})=>{const l=r?p(r):n,d=p(l),c=M(r),o=c?n:d;if(i.keepDefaultValues||(n=l),!i.keepValues){if(i.keepDirtyValues)for(const g of h.mount)f(t.dirtyFields,g)?x(o,g,f(a,g)):I(g,f(o,g));else{if(Re&&w(r))for(const g of h.mount){const A=f(u,g);if(A&&A._f){const E=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(_e(E)){const B=E.closest("form");if(B){B.reset();break}}}}u={}}a=e.shouldUnregister?i.keepDefaultValues?p(n):{}:p(o),v.array.next({values:{...o}}),v.values.next({values:{...o}})}h={mount:i.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},y.mount=!_.isValid||!!i.keepIsValid||!!i.keepDirtyValues,y.watch=!!e.shouldUnregister,v.state.next({submitCount:i.keepSubmitCount?t.submitCount:0,isDirty:c?!1:i.keepDirty?t.isDirty:!!(i.keepDefaultValues&&!Z(r,n)),isSubmitted:i.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:c?{}:i.keepDirtyValues?i.keepDefaultValues&&a?ge(n,a):t.dirtyFields:i.keepDefaultValues&&r?ge(n,r):i.keepDirty?t.dirtyFields:{},touchedFields:i.keepTouched?t.touchedFields:{},errors:i.keepErrors?t.errors:{},isSubmitSuccessful:i.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},He=(r,i)=>We(X(r)?r(a):r,i);return{control:{register:De,unregister:me,getFieldState:Be,handleSubmit:qe,setError:Pe,_executeSchema:Y,_getWatch:F,_getDirty:b,_updateValid:J,_removeUnmounted:ye,_updateFieldArray:V,_updateDisabledField:Ie,_getFieldArray:C,_reset:We,_resetDefaultValues:()=>X(s.defaultValues)&&s.defaultValues().then(r=>{He(r,s.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:r=>{t={...t,...r}},_disableForm:vt,_subjects:v,_proxyFormState:_,_setErrors:G,get _fields(){return u},get _formValues(){return a},get _state(){return y},set _state(r){y=r},get _defaultValues(){return n},get _names(){return h},set _names(r){h=r},get _formState(){return t},set _formState(r){t=r},get _options(){return s},set _options(r){s={...s,...r}}},trigger:ae,register:De,handleSubmit:qe,watch:ht,setValue:I,getValues:Me,reset:He,resetField:_t,clearErrors:gt,unregister:me,setError:Pe,setFocus:(r,i={})=>{const l=f(u,r),d=l&&l._f;if(d){const c=d.refs?d.refs[0]:d.ref;c.focus&&(c.focus(),i.shouldSelect&&c.select())}},getFieldState:Be}}function Ht(e={}){const s=m.useRef(),t=m.useRef(),[u,n]=m.useState({isDirty:!1,isValidating:!1,isLoading:X(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:X(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...Bt(e),formState:u});const a=s.current.control;return a._options=e,Ue({subject:a._subjects.state,next:y=>{ut(y,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),m.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),m.useEffect(()=>{if(a._proxyFormState.isDirty){const y=a._getDirty();y!==u.isDirty&&a._subjects.state.next({isDirty:y})}},[a,u.isDirty]),m.useEffect(()=>{e.values&&!Z(e.values,t.current)?(a._reset(e.values,a._options.resetOptions),t.current=e.values,n(y=>({...y}))):a._resetDefaultValues()},[e.values,a]),m.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),m.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),m.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),s.current.formState=it(u,a),s.current}export{Wt as C,wt as a,Ht as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as i}from"./codemirror.es-
|
|
1
|
+
import{C as i}from"./codemirror.es-DRCfXk0r.js";import"./index-D6q9zEjn.js";import"./index-DzlR4ROA.js";var y=Object.defineProperty,u=(e,t)=>y(e,"name",{value:t,configurable:!0});i.defineOption("info",!1,(e,t,n)=>{if(n&&n!==i.Init){const o=e.state.info.onMouseOver;i.off(e.getWrapperElement(),"mouseover",o),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(t){const o=e.state.info=v(t);o.onMouseOver=h.bind(null,e),i.on(e.getWrapperElement(),"mouseover",o.onMouseOver)}});function v(e){return{options:e instanceof Function?{render:e}:e===!0?{}:e}}u(v,"createState");function g(e){const t=e.state.info.options;return(t==null?void 0:t.hoverTime)||500}u(g,"getHoverTime");function h(e,t){const n=e.state.info,o=t.target||t.srcElement;if(!(o instanceof HTMLElement)||o.nodeName!=="SPAN"||n.hoverTimeout!==void 0)return;const s=o.getBoundingClientRect(),r=u(function(){clearTimeout(n.hoverTimeout),n.hoverTimeout=setTimeout(f,a)},"onMouseMove"),p=u(function(){i.off(document,"mousemove",r),i.off(e.getWrapperElement(),"mouseout",p),clearTimeout(n.hoverTimeout),n.hoverTimeout=void 0},"onMouseOut"),f=u(function(){i.off(document,"mousemove",r),i.off(e.getWrapperElement(),"mouseout",p),n.hoverTimeout=void 0,T(e,s)},"onHover"),a=g(e);n.hoverTimeout=setTimeout(f,a),i.on(document,"mousemove",r),i.on(e.getWrapperElement(),"mouseout",p)}u(h,"onMouseOver");function T(e,t){const n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}),s=e.state.info.options,r=s.render||e.getHelper(n,"info");if(r){const p=e.getTokenAt(n,!0);if(p){const f=r(p,s,e,n);f&&M(e,t,f)}}}u(T,"onMouseHover");function M(e,t,n){const o=document.createElement("div");o.className="CodeMirror-info",o.appendChild(n),document.body.appendChild(o);const s=o.getBoundingClientRect(),r=window.getComputedStyle(o),p=s.right-s.left+parseFloat(r.marginLeft)+parseFloat(r.marginRight),f=s.bottom-s.top+parseFloat(r.marginTop)+parseFloat(r.marginBottom);let a=t.bottom;f>window.innerHeight-t.bottom-15&&t.top>window.innerHeight-t.bottom&&(a=t.top-f),a<0&&(a=t.bottom);let l=Math.max(0,window.innerWidth-p-15);l>t.left&&(l=t.left),o.style.opacity="1",o.style.top=a+"px",o.style.left=l+"px";let d;const c=u(function(){clearTimeout(d)},"onMouseOverPopup"),m=u(function(){clearTimeout(d),d=setTimeout(O,200)},"onMouseOut"),O=u(function(){i.off(o,"mouseover",c),i.off(o,"mouseout",m),i.off(e.getWrapperElement(),"mouseout",m),o.style.opacity?(o.style.opacity="0",setTimeout(()=>{o.parentNode&&o.parentNode.removeChild(o)},600)):o.parentNode&&o.parentNode.removeChild(o)},"hidePopup");i.on(o,"mouseover",c),i.on(o,"mouseout",m),i.on(e.getWrapperElement(),"mouseout",m)}u(M,"showPopup");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as h}from"./codemirror.es-
|
|
1
|
+
import{C as h}from"./codemirror.es-DRCfXk0r.js";import{g as E,a as C,b as N,c as _,d as V,e as x}from"./SchemaReference.es-DmaLWYOX.js";import"./info-addon.es-OU9D4WD4.js";import{Y as A,r as F}from"./index-D6q9zEjn.js";import"./index-DzlR4ROA.js";import"./introspection.es-CPJcz6nz.js";import"./forEachState.es-D8bf0zSr.js";var L=Object.defineProperty,l=(r,e)=>L(r,"name",{value:e,configurable:!0});h.registerHelper("info","graphql",(r,e)=>{if(!e.schema||!r.state)return;const i=r.state,n=i.kind,d=i.step,c=E(e.schema,r.state);if(n==="Field"&&d===0&&c.fieldDef||n==="AliasedField"&&d===2&&c.fieldDef){const a=document.createElement("div");return o(a,c,e),u(a,e,c.fieldDef),a}else if(n==="Directive"&&d===1&&c.directiveDef){const a=document.createElement("div");return f(a,c,e),u(a,e,c.directiveDef),a}else if(n==="Argument"&&d===0&&c.argDef){const a=document.createElement("div");return p(a,c,e),u(a,e,c.argDef),a}else if(n==="EnumValue"&&c.enumValue&&c.enumValue.description){const a=document.createElement("div");return D(a,c,e),u(a,e,c.enumValue),a}else if(n==="NamedType"&&c.type&&c.type.description){const a=document.createElement("div");return m(a,c,e,c.type),u(a,e,c.type),a}});function o(r,e,i){s(r,e,i),v(r,e,i,e.type)}l(o,"renderField");function s(r,e,i){var n;const d=((n=e.fieldDef)===null||n===void 0?void 0:n.name)||"";d.slice(0,2)!=="__"&&(m(r,e,i,e.parentType),t(r,".")),t(r,d,"field-name",i,C(e))}l(s,"renderQualifiedField");function f(r,e,i){var n;const d="@"+(((n=e.directiveDef)===null||n===void 0?void 0:n.name)||"");t(r,d,"directive-name",i,N(e))}l(f,"renderDirective");function p(r,e,i){var n;e.directiveDef?f(r,e,i):e.fieldDef&&s(r,e,i);const d=((n=e.argDef)===null||n===void 0?void 0:n.name)||"";t(r,"("),t(r,d,"arg-name",i,_(e)),v(r,e,i,e.inputType),t(r,")")}l(p,"renderArg");function v(r,e,i,n){t(r,": "),m(r,e,i,n)}l(v,"renderTypeAnnotation");function D(r,e,i){var n;const d=((n=e.enumValue)===null||n===void 0?void 0:n.name)||"";m(r,e,i,e.inputType),t(r,"."),t(r,d,"enum-value",i,V(e))}l(D,"renderEnumValue");function m(r,e,i,n){n instanceof A?(m(r,e,i,n.ofType),t(r,"!")):n instanceof F?(t(r,"["),m(r,e,i,n.ofType),t(r,"]")):t(r,(n==null?void 0:n.name)||"","type-name",i,x(e,n))}l(m,"renderType");function u(r,e,i){const n=i.description;if(n){const d=document.createElement("div");d.className="info-description",e.renderDescription?d.innerHTML=e.renderDescription(n):d.appendChild(document.createTextNode(n)),r.appendChild(d)}T(r,e,i)}l(u,"renderDescription");function T(r,e,i){const n=i.deprecationReason;if(n){const d=document.createElement("div");d.className="info-deprecation",e.renderDescription?d.innerHTML=e.renderDescription(n):d.appendChild(document.createTextNode(n));const c=document.createElement("span");c.className="info-deprecation-label",c.appendChild(document.createTextNode("Deprecated: ")),d.insertBefore(c,d.firstChild),r.appendChild(d)}}l(T,"renderDeprecation");function t(r,e,i="",n={onClick:null},d=null){if(i){const c=n.onClick;let a;c?(a=document.createElement("a"),a.href="javascript:void 0",a.addEventListener("click",g=>{c(d,g)})):a=document.createElement("span"),a.className=i,a.appendChild(document.createTextNode(e)),r.appendChild(a)}else r.appendChild(document.createTextNode(e))}l(t,"text");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as U,j as m,dB as Bt,cN as P,dC as Ht,H as Gt,dD as Ft,b as Wt,Q as qt,dE as Kt,bl as Vt,v as zt,r as D,t as Yt,N as Xt,W as Jt,m as Qt,D as Zt,B as ft,C as pt,x as kt,K as te,y as ee,bm as ie,M as re}from"./index-BHdqgom8.js";import{W as ne}from"./url-evaluation-BTdmiGRO.js";import{s as Et,n as se}from"./schema-5ne-6Bp4.js";import{I as mt}from"./index-D3GDvQdK.js";import{T as oe}from"./TextField-Cml5LlcX.js";import{S as ae,a as le,b as he}from"./Stepper-D4h3SXw3.js";function ce({mode:t,...e}){return t==="development"?m.jsx(ne,{type:"primary",...e,children:"DEV"}):null}ce.propTypes={mode:U.string.isRequired};var _t={},ht={exports:{}},jt={exports:{}},X=jt.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(t){return"file-"+St(t)}}},gt={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:St};Object.keys(X).forEach(function(t){Object.keys(gt).forEach(function(e){X[t][e]||(X[t][e]=gt[e])}),X[t].protocols_re=RegExp("^("+X[t].protocols.map(function(e){return e.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function St(t){return t.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var Ct=jt.exports,dt=Ct,q=Object.assign||function(e,i){if(i===null||typeof i!="object")return e;const r=Object.keys(i);let s=r.length;for(;s--;)e[r[s]]=i[r[s]];return e},ue=j;function j(t,e,i,r,s,a,p){var c=this;c.type=t,Object.keys(dt[t]).forEach(function(g){c[g]=dt[t][g]}),c.user=e,c.auth=i,c.project=r,c.committish=s,c.default=a,c.opts=p||{}}j.prototype.hash=function(){return this.committish?"#"+this.committish:""};j.prototype._fill=function(t,e){if(t){var i=q({},e);i.path=i.path?i.path.replace(/^[/]+/g,""):"",e=q(q({},this.opts),e);var r=this;Object.keys(this).forEach(function(f){r[f]!=null&&i[f]==null&&(i[f]=r[f])});var s=i.auth,a=i.committish,p=i.fragment,c=i.path,g=i.project;Object.keys(i).forEach(function(f){var S=i[f];(f==="path"||f==="project")&&typeof S=="string"?i[f]=S.split("/").map(function(h){return encodeURIComponent(h)}).join("/"):f!=="domain"&&(i[f]=encodeURIComponent(S))}),i["auth@"]=s?s+"@":"",i["#fragment"]=p?"#"+this.hashformat(p):"",i.fragment=i.fragment?i.fragment:"",i["#path"]=c?"#"+this.hashformat(c):"",i["/path"]=i.path?"/"+i.path:"",i.projectPath=g.split("/").map(encodeURIComponent).join("/"),e.noCommittish?(i["#committish"]="",i["/tree/committish"]="",i["/committish"]="",i.committish=""):(i["#committish"]=a?"#"+a:"",i["/tree/committish"]=i.committish?"/"+i.treepath+"/"+i.committish:"",i["/committish"]=i.committish?"/"+i.committish:"",i.committish=i.committish||"master");var x=t;return Object.keys(i).forEach(function(f){x=x.replace(new RegExp("[{]"+f+"[}]","g"),i[f])}),e.noGitPlus?x.replace(/^git[+]/,""):x}};j.prototype.ssh=function(t){return this._fill(this.sshtemplate,t)};j.prototype.sshurl=function(t){return this._fill(this.sshurltemplate,t)};j.prototype.browse=function(t,e,i){return typeof t=="string"?(typeof e!="string"&&(i=e,e=null),this._fill(this.browsefiletemplate,q({fragment:e,path:t},i))):this._fill(this.browsetemplate,t)};j.prototype.docs=function(t){return this._fill(this.docstemplate,t)};j.prototype.bugs=function(t){return this._fill(this.bugstemplate,t)};j.prototype.https=function(t){return this._fill(this.httpstemplate,t)};j.prototype.git=function(t){return this._fill(this.gittemplate,t)};j.prototype.shortcut=function(t){return this._fill(this.shortcuttemplate,t)};j.prototype.path=function(t){return this._fill(this.pathtemplate,t)};j.prototype.tarball=function(t){var e=q({},t,{noCommittish:!1});return this._fill(this.tarballtemplate,e)};j.prototype.file=function(t,e){return this._fill(this.filetemplate,q({path:t},e))};j.prototype.getDefaultRepresentation=function(){return this.default};j.prototype.toString=function(t){return this.default&&typeof this[this.default]=="function"?this[this.default](t):this.sshurl(t)};var nt,vt;function fe(){return vt||(vt=1,nt=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),nt}var pe=l;l.Node=$;l.create=l;function l(t){var e=this;if(e instanceof l||(e=new l),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var i=0,r=arguments.length;i<r;i++)e.push(arguments[i]);return e}l.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,i=t.prev;return e&&(e.prev=i),i&&(i.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=i),t.list.length--,t.next=null,t.prev=null,t.list=null,e};l.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};l.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};l.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)ge(this,arguments[t]);return this.length};l.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)de(this,arguments[t]);return this.length};l.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};l.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};l.prototype.forEach=function(t,e){e=e||this;for(var i=this.head,r=0;i!==null;r++)t.call(e,i.value,r,this),i=i.next};l.prototype.forEachReverse=function(t,e){e=e||this;for(var i=this.tail,r=this.length-1;i!==null;r--)t.call(e,i.value,r,this),i=i.prev};l.prototype.get=function(t){for(var e=0,i=this.head;i!==null&&e<t;e++)i=i.next;if(e===t&&i!==null)return i.value};l.prototype.getReverse=function(t){for(var e=0,i=this.tail;i!==null&&e<t;e++)i=i.prev;if(e===t&&i!==null)return i.value};l.prototype.map=function(t,e){e=e||this;for(var i=new l,r=this.head;r!==null;)i.push(t.call(e,r.value,this)),r=r.next;return i};l.prototype.mapReverse=function(t,e){e=e||this;for(var i=new l,r=this.tail;r!==null;)i.push(t.call(e,r.value,this)),r=r.prev;return i};l.prototype.reduce=function(t,e){var i,r=this.head;if(arguments.length>1)i=e;else if(this.head)r=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;r!==null;s++)i=t(i,r.value,s),r=r.next;return i};l.prototype.reduceReverse=function(t,e){var i,r=this.tail;if(arguments.length>1)i=e;else if(this.tail)r=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;r!==null;s--)i=t(i,r.value,s),r=r.prev;return i};l.prototype.toArray=function(){for(var t=new Array(this.length),e=0,i=this.head;i!==null;e++)t[e]=i.value,i=i.next;return t};l.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,i=this.tail;i!==null;e++)t[e]=i.value,i=i.prev;return t};l.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var i=new l;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,s=this.head;s!==null&&r<t;r++)s=s.next;for(;s!==null&&r<e;r++,s=s.next)i.push(s.value);return i};l.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var i=new l;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,s=this.tail;s!==null&&r>e;r--)s=s.prev;for(;s!==null&&r>t;r--,s=s.prev)i.push(s.value);return i};l.prototype.splice=function(t,e,...i){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,s=this.head;s!==null&&r<t;r++)s=s.next;for(var a=[],r=0;s&&r<e;r++)a.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var r=0;r<i.length;r++)s=me(this,s,i[r]);return a};l.prototype.reverse=function(){for(var t=this.head,e=this.tail,i=t;i!==null;i=i.prev){var r=i.prev;i.prev=i.next,i.next=r}return this.head=e,this.tail=t,this};function me(t,e,i){var r=e===t.head?new $(i,null,e,t):new $(i,e,e.next,t);return r.next===null&&(t.tail=r),r.prev===null&&(t.head=r),t.length++,r}function ge(t,e){t.tail=new $(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function de(t,e){t.head=new $(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function $(t,e,i,r){if(!(this instanceof $))return new $(t,e,i,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,i?(i.prev=this,this.next=i):this.next=null}try{fe()(l)}catch{}const ve=pe,M=Symbol("max"),O=Symbol("length"),F=Symbol("lengthCalculator"),Q=Symbol("allowStale"),N=Symbol("maxAge"),I=Symbol("dispose"),yt=Symbol("noDisposeOnSet"),b=Symbol("lruList"),w=Symbol("cache"),At=Symbol("updateAgeOnGet"),st=()=>1;class ye{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[M]=e.max||1/0;const i=e.length||st;if(this[F]=typeof i!="function"?st:i,this[Q]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[N]=e.maxAge||0,this[I]=e.dispose,this[yt]=e.noDisposeOnSet||!1,this[At]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[M]=e||1/0,J(this)}get max(){return this[M]}set allowStale(e){this[Q]=!!e}get allowStale(){return this[Q]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[N]=e,J(this)}get maxAge(){return this[N]}set lengthCalculator(e){typeof e!="function"&&(e=st),e!==this[F]&&(this[F]=e,this[O]=0,this[b].forEach(i=>{i.length=this[F](i.value,i.key),this[O]+=i.length})),J(this)}get lengthCalculator(){return this[F]}get length(){return this[O]}get itemCount(){return this[b].length}rforEach(e,i){i=i||this;for(let r=this[b].tail;r!==null;){const s=r.prev;bt(this,e,r,i),r=s}}forEach(e,i){i=i||this;for(let r=this[b].head;r!==null;){const s=r.next;bt(this,e,r,i),r=s}}keys(){return this[b].toArray().map(e=>e.key)}values(){return this[b].toArray().map(e=>e.value)}reset(){this[I]&&this[b]&&this[b].length&&this[b].forEach(e=>this[I](e.key,e.value)),this[w]=new Map,this[b]=new ve,this[O]=0}dump(){return this[b].map(e=>k(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[b]}set(e,i,r){if(r=r||this[N],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const s=r?Date.now():0,a=this[F](i,e);if(this[w].has(e)){if(a>this[M])return K(this,this[w].get(e)),!1;const g=this[w].get(e).value;return this[I]&&(this[yt]||this[I](e,g.value)),g.now=s,g.maxAge=r,g.value=i,this[O]+=a-g.length,g.length=a,this.get(e),J(this),!0}const p=new be(e,i,a,s,r);return p.length>this[M]?(this[I]&&this[I](e,i),!1):(this[O]+=p.length,this[b].unshift(p),this[w].set(e,this[b].head),J(this),!0)}has(e){if(!this[w].has(e))return!1;const i=this[w].get(e).value;return!k(this,i)}get(e){return ot(this,e,!0)}peek(e){return ot(this,e,!1)}pop(){const e=this[b].tail;return e?(K(this,e),e.value):null}del(e){K(this,this[w].get(e))}load(e){this.reset();const i=Date.now();for(let r=e.length-1;r>=0;r--){const s=e[r],a=s.e||0;if(a===0)this.set(s.k,s.v);else{const p=a-i;p>0&&this.set(s.k,s.v,p)}}}prune(){this[w].forEach((e,i)=>ot(this,i,!1))}}const ot=(t,e,i)=>{const r=t[w].get(e);if(r){const s=r.value;if(k(t,s)){if(K(t,r),!t[Q])return}else i&&(t[At]&&(r.value.now=Date.now()),t[b].unshiftNode(r));return s.value}},k=(t,e)=>{if(!e||!e.maxAge&&!t[N])return!1;const i=Date.now()-e.now;return e.maxAge?i>e.maxAge:t[N]&&i>t[N]},J=t=>{if(t[O]>t[M])for(let e=t[b].tail;t[O]>t[M]&&e!==null;){const i=e.prev;K(t,e),e=i}},K=(t,e)=>{if(e){const i=e.value;t[I]&&t[I](i.key,i.value),t[O]-=i.length,t[w].delete(i.key),t[b].removeNode(e)}};class be{constructor(e,i,r,s,a){this.key=e,this.value=i,this.length=r,this.now=s,this.maxAge=a||0}}const bt=(t,e,i,r)=>{let s=i.value;k(t,s)&&(K(t,i),t[Q]||(s=void 0)),s&&e.call(r,s.value,s.key,t)};var xe=ye,lt=Bt,xt=Ct,Ee=ht.exports=ue,_e=xe,at=new _e({max:1e3}),je={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Se(t){return je[t]||t.slice(0,-1)}var Ce={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};ht.exports.fromUrl=function(t,e){if(typeof t=="string"){var i=t+JSON.stringify(e||{});return at.has(i)||at.set(i,Ae(t,e)),at.get(i)}};function Ae(t,e){if(!(t==null||t==="")){var i=Re(we(t)?"github:"+t:t),r=Pe(i),s=i.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),a=Object.keys(xt).map(function(p){try{var c=xt[p],g=null;r.auth&&Ce[r.protocol]&&(g=r.auth);var x=r.hash?decodeURIComponent(r.hash.substr(1)):null,f=null,S=null,h=null;if(s&&s[1]===p)f=s[2]&&decodeURIComponent(s[2]),S=decodeURIComponent(s[3].replace(/\.git$/,"")),h="shortcut";else{if(r.host&&r.host!==c.domain&&r.host.replace(/^www[.]/,"")!==c.domain||!c.protocols_re.test(r.protocol)||!r.path)return;var H=c.pathmatch,C=r.path.match(H);if(!C)return;C[1]!==null&&C[1]!==void 0&&(f=decodeURIComponent(C[1].replace(/^:/,""))),S=decodeURIComponent(C[2]),h=Se(r.protocol)}return new Ee(p,f,g,S,x,h,e)}catch(A){if(!(A instanceof URIError))throw A}}).filter(function(p){return p});if(a.length===1)return a[0]}}function we(t){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(t)}function Re(t){var e=lt.parse(t);return e.protocol==="gist:"&&e.host&&!e.path?e.protocol+"/"+e.host:t}function Pe(t){var e=t.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!e){var i=lt.parse(t);if(i.auth){const s=t.match(/[^@]+@[^:/]+/);if(s){var r=new lt.URL(s[0]);i.auth=r.username||"",r.password&&(i.auth+=":"+r.password)}}return i}return{protocol:"git+ssh:",slashes:!0,auth:e[1],host:e[2],port:null,hostname:e[2],hash:e[4],search:null,query:null,pathname:"/"+e[3],path:"/"+e[3],href:"git+ssh://"+e[1]+"@"+e[2]+"/"+e[3]+(e[4]||"")}}var Ie=ht.exports,B={},R={},wt=P&&P.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(R,"__esModule",{value:!0});R.setService=R.findService=R.getDefaultServiceConfig=R.getServiceConfig=void 0;const Ue=wt(Ht),Oe=wt(Gt),Te=Et,{NODE_SERVICES:W}=Oe.default,Z={},ct=t=>{Z[t.name]={validate:t.schema.validate.bind(t.schema),defaultConfig:t.default}};R.setService=ct;ct({name:"auth",schema:Te.authConfigSchema,default:{}});Z[W.AUTH_SERVICE]={...Z[W.AUTH],meta:{...Z[W.AUTH].meta,name:W.AUTH_SERVICE}};const Rt=t=>{if(!t)throw new Error("service name should not be empty");const e=Z[t];if(!e)throw new Error(`service ${t} does not exist`);return e},Pt=(t,e,{validate:i}={})=>{const r=Rt(t),s=(0,Ue.default)(e||{}),{value:a,error:p}=r.validate(s);if(i&&p)throw new Error(`Invalid blocklet service config: ${p.details.map(c=>c.message).join(", ")}`);return a};R.getServiceConfig=Pt;const It=t=>{const{defaultConfig:e}=Rt(t);return e};R.getDefaultServiceConfig=It;const Ut=(t,e)=>{const i=[e];return e===W.AUTH&&i.push(W.AUTH_SERVICE),(t||[]).find(r=>i.includes(r.name))};R.findService=Ut;R.default={getServiceConfig:Pt,getDefaultServiceConfig:It,findService:Ut,setService:ct};Object.defineProperty(B,"__esModule",{value:!0});B.fixAndValidateService=B.validateMeta=void 0;const De=Et,Le=R,Me=t=>(!t.interfaces||!t.interfaces.length||t.interfaces.forEach(e=>{e.services&&e.services.length&&e.services.forEach(i=>{i.config=(0,Le.getServiceConfig)(i.name,i.config,{validate:!0})})}),t);B.fixAndValidateService=Me;const Ot=(t,{ensureFiles:e=!1,ensureDist:i=!1,ensureComponentStore:r=!0,ensureName:s=!1,skipValidateDidName:a=!1,schemaOptions:p={}}={})=>{const c=(0,De.createBlockletSchema)(null,{ensureFiles:e,ensureDist:i,ensureComponentStore:r,ensureName:s,skipValidateDidName:a,...p}),{value:g,error:x}=c.validate(t);if(x)throw new Error(`Invalid blocklet meta: ${x.details.map(f=>f.message).join(", ")}`);return g};B.validateMeta=Ot;B.default=Ot;(function(t){var e=P&&P.__createBinding||(Object.create?function(n,o,d,_){_===void 0&&(_=d);var v=Object.getOwnPropertyDescriptor(o,d);(!v||("get"in v?!o.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return o[d]}}),Object.defineProperty(n,_,v)}:function(n,o,d,_){_===void 0&&(_=d),n[_]=o[d]}),i=P&&P.__setModuleDefault||(Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o}),r=P&&P.__importStar||function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var d in n)d!=="default"&&Object.prototype.hasOwnProperty.call(n,d)&&e(o,n,d);return i(o,n),o},s=P&&P.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.fixService=t.fixInterfaces=t.parsePerson=t.formatPerson=t.fixName=t.fixTags=t.fixPerson=t.fixKeywords=t.fixFiles=t.fixRepository=t.fixRequired=void 0;const a=s(Ft),p=r(Ie),c=Wt,g=B;Object.defineProperty(t,"fixService",{enumerable:!0,get:function(){return g.fixAndValidateService}});const x=se,f=(n,o)=>{n.description||(n.description=`Blocklet from ${o}`),n.version||(n.version=c.BLOCKLET_DEFAULT_VERSION)};t.fixRequired=f;const S=n=>{if(n.repository&&(typeof n.repository=="string"&&(n.repository={type:"git",url:n.repository}),n.repository.url)){const o=p.fromUrl(n.repository.url);o&&(n.repository.url=o.getDefaultRepresentation()==="shortcut"?o.https():o.toString())}};t.fixRepository=S;const h=n=>{Array.isArray(n.files)?n.files&&(n.files=n.files.filter(o=>!(!o||typeof o!="string"))):delete n.files};t.fixFiles=h;const H=n=>{typeof n.keywords=="string"&&(n.keywords=n.keywords.split(/,\s+/)),n.keywords&&!Array.isArray(n.keywords)?delete n.keywords:n.keywords&&(n.keywords=n.keywords.filter(o=>!(typeof o!="string"||!o)))};t.fixKeywords=H;const C=n=>{typeof n.tags=="string"&&(n.tags=n.tags.split(/,\s+/)),n.tags&&!Array.isArray(n.tags)?delete n.tags:n.tags&&(n.tags=n.tags.filter(o=>!(typeof o!="string"||!o)))};t.fixTags=C;const A=(n,o)=>(n.author&&(n.author=o(n.author)),["maintainers","contributors"].forEach(d=>{Array.isArray(n[d])&&(n[d]=n[d].map(o))}),n),V=n=>{if(!n)return"";if(typeof n=="string")return n;const o=n.name||"",d=n.url||n.web,_=d?` (${d})`:"",v=n.email||n.mail,y=v?` <${v}>`:"";return o+y+_};t.formatPerson=V;const T=n=>{if(typeof n!="string")return n;const o=n.match(/^([^(<]+)/),d=n.match(/\(([^)]+)\)/),_=n.match(/<([^>]+)>/),v={};return o&&o[0].trim()&&(v.name=o[0].trim()),_&&([,v.email]=_),d&&([,v.url]=d),v};t.parsePerson=T;const G=n=>(A(n,V),A(n,T),n);t.fixPerson=G;const E=(n,o=!0)=>{if(Array.isArray(n.interfaces)||(n.interfaces=[]),n.interfaces.length)return n.interfaces.forEach(y=>{y.type===c.BLOCKLET_INTERFACE_TYPE_WEB&&(y.protocol="http")}),n;const _=(0,a.default)(n,"capabilities.dynamicPathPrefix",!0)?c.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",v=({type:y="web",name:Y,path:tt="/",protocol:et="http",port:it=c.BLOCKLET_DEFAULT_PORT_NAME})=>{n.interfaces.push({type:y,name:Y,path:tt,prefix:_,port:it,protocol:et})};return[c.BLOCKLET_INTERFACE_PUBLIC].forEach(y=>{n[y]&&v({name:y,path:n[y]})}),Array.isArray(n.exposeServices)&&n.exposeServices.forEach(y=>{v({type:"service",name:y.protocol,protocol:y.protocol,port:{internal:`BLOCKLET_${y.protocol}_PORT`.toUpperCase(),external:y.port}})}),o&&(delete n.publicUrl,delete n.adminUrl,delete n.configUrl,delete n.docUrl,delete n.exposeServices,n.capabilities&&delete n.capabilities.dynamicPathPrefix),n};t.fixInterfaces=E;const z=n=>{const{did:o}=n;try{(0,x.validateNewDid)(o),n.name=o}catch{}return n};t.fixName=z,t.default={fixRequired:f,fixRepository:S,fixFiles:h,fixKeywords:H,fixPerson:G,fixTags:C,fixName:z,formatPerson:V,parsePerson:T,fixInterfaces:E,fixService:g.fixAndValidateService}})(_t);function Tt({owner:t,locale:e}){return m.jsxs(qt,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.fullName,t.did?m.jsx(Kt,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:t.did,compact:!0,size:14,locale:e}):null]})}Tt.propTypes={owner:U.object.isRequired,locale:U.string.isRequired};function Dt({defaultUrl:t,onCancel:e,onSuccess:i,onError:r,mode:s,handleText:a}){const{api:p}=Vt(),{api:c}=zt(),[g,x]=D.useState(!1),[f,S]=D.useState(""),{t:h,locale:H}=Yt(),C={dist:{}},[A,V]=D.useState(t),[T,G]=D.useState(t?1:0),[E,z]=D.useState(C),[n,o]=D.useState(!1),[d,_]=D.useState({}),v=s==="component",y=v?!0:!t,Y=async()=>{z(C),S(null),x(!0);try{const u=decodeURIComponent(A.trim());try{new URL(u)}catch{throw new Error("Invalid URL")}const{meta:rt,inStore:Nt,registryUrl:$t}=await p.getBlockletMetaFromUrl({input:{url:u}});z(rt),_({inStore:Nt,registryUrl:$t,inputUrl:A.trim()})}catch(u){console.error(u);const rt=`Blocklet Install failed: ${re(u)}`;S(rt),r(u)}finally{x(!1)}},tt=()=>{if(v){i({meta:E,...d}),e();return}x(!0),o(!0)},et=()=>{x(!1),o(!1),i({meta:E,...d}),e()},it=()=>{x(!1),o(!1)};D.useEffect(()=>{t&&Y()},[t]);const Lt=[{name:h("common.name"),value:Xt.getDisplayName({meta:E},!0)},{name:h("common.version"),value:E.version},{name:h("common.did"),value:m.jsx(Jt,{did:E.did})},{name:h("common.author"),value:E.owner?m.jsx(Tt,{owner:E.owner,locale:H}):_t.formatPerson(E.author)},{name:h("blocklet.dist.downloadLink"),value:E.dist.tarball}],Mt=()=>g?m.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:m.jsx(pt,{})}):E.did?m.jsx("div",{style:{paddingLeft:"10%"},children:Lt.map(u=>u.name===h("common.did")?m.jsx(mt,{valueComponent:"div",nameWidth:120,name:u.name,nameFormatter:()=>h("common.did"),children:u.value},u.name):m.jsx(mt,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.name))}):null,ut=[{label:h("blocklet.fromUrl.step0"),body:m.jsx(Qt,{component:"div",children:m.jsx(oe,{label:h("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,style:{marginBottom:32},margin:"dense",helperText:h("blocklet.fromUrl.description"),value:A,onChange:u=>{S(null),V(u.target.value)},disabled:g,onKeyPress:u=>{u.key==="Enter"&&(u.preventDefault(),Y(),G(1))}})}),cancel:h("common.cancel"),confirm:h("common.next"),onCancel:e,onConfirm:()=>{Y(),G(1)}},{label:h("blocklet.fromUrl.step1"),body:Mt(),cancel:h(y?"common.pre":"common.cancel"),confirm:(a==null?void 0:a.confirm)||h("blocklet.fromUrl.confirm"),onCancel:()=>{y?G(u=>u-1):e()},onConfirm:()=>{tt()}}],L=ut[T];return m.jsxs(m.Fragment,{children:[m.jsxs(Zt,{title:(a==null?void 0:a.title)||h("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>L.onCancel(),showCloseButton:T===0,disableEscapeKeyDown:!0,open:!0,actions:m.jsxs(m.Fragment,{children:[L.cancel&&m.jsx(ft,{onClick:u=>{u.stopPropagation(),S(null),L.onCancel()},color:"inherit",children:L.cancel||h("common.cancel")}),m.jsxs(ft,{onClick:u=>{u.stopPropagation(),L.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:g||!A||f,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[g&&T===0&&m.jsx(pt,{size:16}),L.confirm]})]}),children:[y&&m.jsx(ae,{alternativeLabel:!0,activeStep:T,children:ut.map(({label:u})=>m.jsx(le,{children:m.jsx(he,{children:u})},u))}),m.jsx(kt,{component:"div",style:{marginTop:24},children:L.body}),!!f&&m.jsx(te,{severity:"error",style:{width:"100%",marginTop:8},children:f})]}),E&&n&&m.jsx(ee,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:c.get,checkTimeout:5*60*1e3,onSuccess:et,extraParams:{title:E.title,wt:ie(E),blockletMetaUrl:decodeURIComponent(A.trim())},messages:{title:h("setup.keyPair.title"),scan:h("setup.keyPair.scan"),confirm:h("setup.keyPair.confirm"),success:h("setup.keyPair.success")},onClose:it})]})}Dt.propTypes={defaultUrl:U.string,onCancel:U.func.isRequired,onSuccess:U.func.isRequired,onError:U.func,mode:U.oneOf(["install","component"]),handleText:U.object};Dt.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};export{ce as B,Dt as I,Tt as a,_t as f};
|
|
1
|
+
import{P as U,j as m,dB as Bt,cN as P,dC as Ht,H as Gt,dD as Ft,b as Wt,Q as qt,dE as Kt,bl as Vt,v as zt,r as D,t as Yt,N as Xt,W as Jt,m as Qt,D as Zt,B as ft,C as pt,x as kt,K as te,y as ee,bm as ie,M as re}from"./index-DzlR4ROA.js";import{W as ne}from"./url-evaluation-C7b_jErN.js";import{s as Et,n as se}from"./schema-Bq2ly-4o.js";import{I as mt}from"./index-8azRnZez.js";import{T as oe}from"./TextField-BjNW7Bjw.js";import{S as ae,a as le,b as he}from"./Stepper-BRwbb4LL.js";function ce({mode:t,...e}){return t==="development"?m.jsx(ne,{type:"primary",...e,children:"DEV"}):null}ce.propTypes={mode:U.string.isRequired};var _t={},ht={exports:{}},jt={exports:{}},X=jt.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(t){return"file-"+St(t)}}},gt={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:St};Object.keys(X).forEach(function(t){Object.keys(gt).forEach(function(e){X[t][e]||(X[t][e]=gt[e])}),X[t].protocols_re=RegExp("^("+X[t].protocols.map(function(e){return e.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function St(t){return t.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var Ct=jt.exports,dt=Ct,q=Object.assign||function(e,i){if(i===null||typeof i!="object")return e;const r=Object.keys(i);let s=r.length;for(;s--;)e[r[s]]=i[r[s]];return e},ue=j;function j(t,e,i,r,s,a,p){var c=this;c.type=t,Object.keys(dt[t]).forEach(function(g){c[g]=dt[t][g]}),c.user=e,c.auth=i,c.project=r,c.committish=s,c.default=a,c.opts=p||{}}j.prototype.hash=function(){return this.committish?"#"+this.committish:""};j.prototype._fill=function(t,e){if(t){var i=q({},e);i.path=i.path?i.path.replace(/^[/]+/g,""):"",e=q(q({},this.opts),e);var r=this;Object.keys(this).forEach(function(f){r[f]!=null&&i[f]==null&&(i[f]=r[f])});var s=i.auth,a=i.committish,p=i.fragment,c=i.path,g=i.project;Object.keys(i).forEach(function(f){var S=i[f];(f==="path"||f==="project")&&typeof S=="string"?i[f]=S.split("/").map(function(h){return encodeURIComponent(h)}).join("/"):f!=="domain"&&(i[f]=encodeURIComponent(S))}),i["auth@"]=s?s+"@":"",i["#fragment"]=p?"#"+this.hashformat(p):"",i.fragment=i.fragment?i.fragment:"",i["#path"]=c?"#"+this.hashformat(c):"",i["/path"]=i.path?"/"+i.path:"",i.projectPath=g.split("/").map(encodeURIComponent).join("/"),e.noCommittish?(i["#committish"]="",i["/tree/committish"]="",i["/committish"]="",i.committish=""):(i["#committish"]=a?"#"+a:"",i["/tree/committish"]=i.committish?"/"+i.treepath+"/"+i.committish:"",i["/committish"]=i.committish?"/"+i.committish:"",i.committish=i.committish||"master");var x=t;return Object.keys(i).forEach(function(f){x=x.replace(new RegExp("[{]"+f+"[}]","g"),i[f])}),e.noGitPlus?x.replace(/^git[+]/,""):x}};j.prototype.ssh=function(t){return this._fill(this.sshtemplate,t)};j.prototype.sshurl=function(t){return this._fill(this.sshurltemplate,t)};j.prototype.browse=function(t,e,i){return typeof t=="string"?(typeof e!="string"&&(i=e,e=null),this._fill(this.browsefiletemplate,q({fragment:e,path:t},i))):this._fill(this.browsetemplate,t)};j.prototype.docs=function(t){return this._fill(this.docstemplate,t)};j.prototype.bugs=function(t){return this._fill(this.bugstemplate,t)};j.prototype.https=function(t){return this._fill(this.httpstemplate,t)};j.prototype.git=function(t){return this._fill(this.gittemplate,t)};j.prototype.shortcut=function(t){return this._fill(this.shortcuttemplate,t)};j.prototype.path=function(t){return this._fill(this.pathtemplate,t)};j.prototype.tarball=function(t){var e=q({},t,{noCommittish:!1});return this._fill(this.tarballtemplate,e)};j.prototype.file=function(t,e){return this._fill(this.filetemplate,q({path:t},e))};j.prototype.getDefaultRepresentation=function(){return this.default};j.prototype.toString=function(t){return this.default&&typeof this[this.default]=="function"?this[this.default](t):this.sshurl(t)};var nt,vt;function fe(){return vt||(vt=1,nt=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),nt}var pe=l;l.Node=$;l.create=l;function l(t){var e=this;if(e instanceof l||(e=new l),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var i=0,r=arguments.length;i<r;i++)e.push(arguments[i]);return e}l.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,i=t.prev;return e&&(e.prev=i),i&&(i.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=i),t.list.length--,t.next=null,t.prev=null,t.list=null,e};l.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};l.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};l.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)ge(this,arguments[t]);return this.length};l.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)de(this,arguments[t]);return this.length};l.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};l.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};l.prototype.forEach=function(t,e){e=e||this;for(var i=this.head,r=0;i!==null;r++)t.call(e,i.value,r,this),i=i.next};l.prototype.forEachReverse=function(t,e){e=e||this;for(var i=this.tail,r=this.length-1;i!==null;r--)t.call(e,i.value,r,this),i=i.prev};l.prototype.get=function(t){for(var e=0,i=this.head;i!==null&&e<t;e++)i=i.next;if(e===t&&i!==null)return i.value};l.prototype.getReverse=function(t){for(var e=0,i=this.tail;i!==null&&e<t;e++)i=i.prev;if(e===t&&i!==null)return i.value};l.prototype.map=function(t,e){e=e||this;for(var i=new l,r=this.head;r!==null;)i.push(t.call(e,r.value,this)),r=r.next;return i};l.prototype.mapReverse=function(t,e){e=e||this;for(var i=new l,r=this.tail;r!==null;)i.push(t.call(e,r.value,this)),r=r.prev;return i};l.prototype.reduce=function(t,e){var i,r=this.head;if(arguments.length>1)i=e;else if(this.head)r=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;r!==null;s++)i=t(i,r.value,s),r=r.next;return i};l.prototype.reduceReverse=function(t,e){var i,r=this.tail;if(arguments.length>1)i=e;else if(this.tail)r=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;r!==null;s--)i=t(i,r.value,s),r=r.prev;return i};l.prototype.toArray=function(){for(var t=new Array(this.length),e=0,i=this.head;i!==null;e++)t[e]=i.value,i=i.next;return t};l.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,i=this.tail;i!==null;e++)t[e]=i.value,i=i.prev;return t};l.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var i=new l;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,s=this.head;s!==null&&r<t;r++)s=s.next;for(;s!==null&&r<e;r++,s=s.next)i.push(s.value);return i};l.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var i=new l;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,s=this.tail;s!==null&&r>e;r--)s=s.prev;for(;s!==null&&r>t;r--,s=s.prev)i.push(s.value);return i};l.prototype.splice=function(t,e,...i){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,s=this.head;s!==null&&r<t;r++)s=s.next;for(var a=[],r=0;s&&r<e;r++)a.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var r=0;r<i.length;r++)s=me(this,s,i[r]);return a};l.prototype.reverse=function(){for(var t=this.head,e=this.tail,i=t;i!==null;i=i.prev){var r=i.prev;i.prev=i.next,i.next=r}return this.head=e,this.tail=t,this};function me(t,e,i){var r=e===t.head?new $(i,null,e,t):new $(i,e,e.next,t);return r.next===null&&(t.tail=r),r.prev===null&&(t.head=r),t.length++,r}function ge(t,e){t.tail=new $(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function de(t,e){t.head=new $(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function $(t,e,i,r){if(!(this instanceof $))return new $(t,e,i,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,i?(i.prev=this,this.next=i):this.next=null}try{fe()(l)}catch{}const ve=pe,M=Symbol("max"),O=Symbol("length"),F=Symbol("lengthCalculator"),Q=Symbol("allowStale"),N=Symbol("maxAge"),I=Symbol("dispose"),yt=Symbol("noDisposeOnSet"),b=Symbol("lruList"),w=Symbol("cache"),At=Symbol("updateAgeOnGet"),st=()=>1;class ye{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[M]=e.max||1/0;const i=e.length||st;if(this[F]=typeof i!="function"?st:i,this[Q]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[N]=e.maxAge||0,this[I]=e.dispose,this[yt]=e.noDisposeOnSet||!1,this[At]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[M]=e||1/0,J(this)}get max(){return this[M]}set allowStale(e){this[Q]=!!e}get allowStale(){return this[Q]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[N]=e,J(this)}get maxAge(){return this[N]}set lengthCalculator(e){typeof e!="function"&&(e=st),e!==this[F]&&(this[F]=e,this[O]=0,this[b].forEach(i=>{i.length=this[F](i.value,i.key),this[O]+=i.length})),J(this)}get lengthCalculator(){return this[F]}get length(){return this[O]}get itemCount(){return this[b].length}rforEach(e,i){i=i||this;for(let r=this[b].tail;r!==null;){const s=r.prev;bt(this,e,r,i),r=s}}forEach(e,i){i=i||this;for(let r=this[b].head;r!==null;){const s=r.next;bt(this,e,r,i),r=s}}keys(){return this[b].toArray().map(e=>e.key)}values(){return this[b].toArray().map(e=>e.value)}reset(){this[I]&&this[b]&&this[b].length&&this[b].forEach(e=>this[I](e.key,e.value)),this[w]=new Map,this[b]=new ve,this[O]=0}dump(){return this[b].map(e=>k(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[b]}set(e,i,r){if(r=r||this[N],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const s=r?Date.now():0,a=this[F](i,e);if(this[w].has(e)){if(a>this[M])return K(this,this[w].get(e)),!1;const g=this[w].get(e).value;return this[I]&&(this[yt]||this[I](e,g.value)),g.now=s,g.maxAge=r,g.value=i,this[O]+=a-g.length,g.length=a,this.get(e),J(this),!0}const p=new be(e,i,a,s,r);return p.length>this[M]?(this[I]&&this[I](e,i),!1):(this[O]+=p.length,this[b].unshift(p),this[w].set(e,this[b].head),J(this),!0)}has(e){if(!this[w].has(e))return!1;const i=this[w].get(e).value;return!k(this,i)}get(e){return ot(this,e,!0)}peek(e){return ot(this,e,!1)}pop(){const e=this[b].tail;return e?(K(this,e),e.value):null}del(e){K(this,this[w].get(e))}load(e){this.reset();const i=Date.now();for(let r=e.length-1;r>=0;r--){const s=e[r],a=s.e||0;if(a===0)this.set(s.k,s.v);else{const p=a-i;p>0&&this.set(s.k,s.v,p)}}}prune(){this[w].forEach((e,i)=>ot(this,i,!1))}}const ot=(t,e,i)=>{const r=t[w].get(e);if(r){const s=r.value;if(k(t,s)){if(K(t,r),!t[Q])return}else i&&(t[At]&&(r.value.now=Date.now()),t[b].unshiftNode(r));return s.value}},k=(t,e)=>{if(!e||!e.maxAge&&!t[N])return!1;const i=Date.now()-e.now;return e.maxAge?i>e.maxAge:t[N]&&i>t[N]},J=t=>{if(t[O]>t[M])for(let e=t[b].tail;t[O]>t[M]&&e!==null;){const i=e.prev;K(t,e),e=i}},K=(t,e)=>{if(e){const i=e.value;t[I]&&t[I](i.key,i.value),t[O]-=i.length,t[w].delete(i.key),t[b].removeNode(e)}};class be{constructor(e,i,r,s,a){this.key=e,this.value=i,this.length=r,this.now=s,this.maxAge=a||0}}const bt=(t,e,i,r)=>{let s=i.value;k(t,s)&&(K(t,i),t[Q]||(s=void 0)),s&&e.call(r,s.value,s.key,t)};var xe=ye,lt=Bt,xt=Ct,Ee=ht.exports=ue,_e=xe,at=new _e({max:1e3}),je={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Se(t){return je[t]||t.slice(0,-1)}var Ce={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};ht.exports.fromUrl=function(t,e){if(typeof t=="string"){var i=t+JSON.stringify(e||{});return at.has(i)||at.set(i,Ae(t,e)),at.get(i)}};function Ae(t,e){if(!(t==null||t==="")){var i=Re(we(t)?"github:"+t:t),r=Pe(i),s=i.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),a=Object.keys(xt).map(function(p){try{var c=xt[p],g=null;r.auth&&Ce[r.protocol]&&(g=r.auth);var x=r.hash?decodeURIComponent(r.hash.substr(1)):null,f=null,S=null,h=null;if(s&&s[1]===p)f=s[2]&&decodeURIComponent(s[2]),S=decodeURIComponent(s[3].replace(/\.git$/,"")),h="shortcut";else{if(r.host&&r.host!==c.domain&&r.host.replace(/^www[.]/,"")!==c.domain||!c.protocols_re.test(r.protocol)||!r.path)return;var H=c.pathmatch,C=r.path.match(H);if(!C)return;C[1]!==null&&C[1]!==void 0&&(f=decodeURIComponent(C[1].replace(/^:/,""))),S=decodeURIComponent(C[2]),h=Se(r.protocol)}return new Ee(p,f,g,S,x,h,e)}catch(A){if(!(A instanceof URIError))throw A}}).filter(function(p){return p});if(a.length===1)return a[0]}}function we(t){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(t)}function Re(t){var e=lt.parse(t);return e.protocol==="gist:"&&e.host&&!e.path?e.protocol+"/"+e.host:t}function Pe(t){var e=t.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!e){var i=lt.parse(t);if(i.auth){const s=t.match(/[^@]+@[^:/]+/);if(s){var r=new lt.URL(s[0]);i.auth=r.username||"",r.password&&(i.auth+=":"+r.password)}}return i}return{protocol:"git+ssh:",slashes:!0,auth:e[1],host:e[2],port:null,hostname:e[2],hash:e[4],search:null,query:null,pathname:"/"+e[3],path:"/"+e[3],href:"git+ssh://"+e[1]+"@"+e[2]+"/"+e[3]+(e[4]||"")}}var Ie=ht.exports,B={},R={},wt=P&&P.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(R,"__esModule",{value:!0});R.setService=R.findService=R.getDefaultServiceConfig=R.getServiceConfig=void 0;const Ue=wt(Ht),Oe=wt(Gt),Te=Et,{NODE_SERVICES:W}=Oe.default,Z={},ct=t=>{Z[t.name]={validate:t.schema.validate.bind(t.schema),defaultConfig:t.default}};R.setService=ct;ct({name:"auth",schema:Te.authConfigSchema,default:{}});Z[W.AUTH_SERVICE]={...Z[W.AUTH],meta:{...Z[W.AUTH].meta,name:W.AUTH_SERVICE}};const Rt=t=>{if(!t)throw new Error("service name should not be empty");const e=Z[t];if(!e)throw new Error(`service ${t} does not exist`);return e},Pt=(t,e,{validate:i}={})=>{const r=Rt(t),s=(0,Ue.default)(e||{}),{value:a,error:p}=r.validate(s);if(i&&p)throw new Error(`Invalid blocklet service config: ${p.details.map(c=>c.message).join(", ")}`);return a};R.getServiceConfig=Pt;const It=t=>{const{defaultConfig:e}=Rt(t);return e};R.getDefaultServiceConfig=It;const Ut=(t,e)=>{const i=[e];return e===W.AUTH&&i.push(W.AUTH_SERVICE),(t||[]).find(r=>i.includes(r.name))};R.findService=Ut;R.default={getServiceConfig:Pt,getDefaultServiceConfig:It,findService:Ut,setService:ct};Object.defineProperty(B,"__esModule",{value:!0});B.fixAndValidateService=B.validateMeta=void 0;const De=Et,Le=R,Me=t=>(!t.interfaces||!t.interfaces.length||t.interfaces.forEach(e=>{e.services&&e.services.length&&e.services.forEach(i=>{i.config=(0,Le.getServiceConfig)(i.name,i.config,{validate:!0})})}),t);B.fixAndValidateService=Me;const Ot=(t,{ensureFiles:e=!1,ensureDist:i=!1,ensureComponentStore:r=!0,ensureName:s=!1,skipValidateDidName:a=!1,schemaOptions:p={}}={})=>{const c=(0,De.createBlockletSchema)(null,{ensureFiles:e,ensureDist:i,ensureComponentStore:r,ensureName:s,skipValidateDidName:a,...p}),{value:g,error:x}=c.validate(t);if(x)throw new Error(`Invalid blocklet meta: ${x.details.map(f=>f.message).join(", ")}`);return g};B.validateMeta=Ot;B.default=Ot;(function(t){var e=P&&P.__createBinding||(Object.create?function(n,o,d,_){_===void 0&&(_=d);var v=Object.getOwnPropertyDescriptor(o,d);(!v||("get"in v?!o.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return o[d]}}),Object.defineProperty(n,_,v)}:function(n,o,d,_){_===void 0&&(_=d),n[_]=o[d]}),i=P&&P.__setModuleDefault||(Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o}),r=P&&P.__importStar||function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var d in n)d!=="default"&&Object.prototype.hasOwnProperty.call(n,d)&&e(o,n,d);return i(o,n),o},s=P&&P.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.fixService=t.fixInterfaces=t.parsePerson=t.formatPerson=t.fixName=t.fixTags=t.fixPerson=t.fixKeywords=t.fixFiles=t.fixRepository=t.fixRequired=void 0;const a=s(Ft),p=r(Ie),c=Wt,g=B;Object.defineProperty(t,"fixService",{enumerable:!0,get:function(){return g.fixAndValidateService}});const x=se,f=(n,o)=>{n.description||(n.description=`Blocklet from ${o}`),n.version||(n.version=c.BLOCKLET_DEFAULT_VERSION)};t.fixRequired=f;const S=n=>{if(n.repository&&(typeof n.repository=="string"&&(n.repository={type:"git",url:n.repository}),n.repository.url)){const o=p.fromUrl(n.repository.url);o&&(n.repository.url=o.getDefaultRepresentation()==="shortcut"?o.https():o.toString())}};t.fixRepository=S;const h=n=>{Array.isArray(n.files)?n.files&&(n.files=n.files.filter(o=>!(!o||typeof o!="string"))):delete n.files};t.fixFiles=h;const H=n=>{typeof n.keywords=="string"&&(n.keywords=n.keywords.split(/,\s+/)),n.keywords&&!Array.isArray(n.keywords)?delete n.keywords:n.keywords&&(n.keywords=n.keywords.filter(o=>!(typeof o!="string"||!o)))};t.fixKeywords=H;const C=n=>{typeof n.tags=="string"&&(n.tags=n.tags.split(/,\s+/)),n.tags&&!Array.isArray(n.tags)?delete n.tags:n.tags&&(n.tags=n.tags.filter(o=>!(typeof o!="string"||!o)))};t.fixTags=C;const A=(n,o)=>(n.author&&(n.author=o(n.author)),["maintainers","contributors"].forEach(d=>{Array.isArray(n[d])&&(n[d]=n[d].map(o))}),n),V=n=>{if(!n)return"";if(typeof n=="string")return n;const o=n.name||"",d=n.url||n.web,_=d?` (${d})`:"",v=n.email||n.mail,y=v?` <${v}>`:"";return o+y+_};t.formatPerson=V;const T=n=>{if(typeof n!="string")return n;const o=n.match(/^([^(<]+)/),d=n.match(/\(([^)]+)\)/),_=n.match(/<([^>]+)>/),v={};return o&&o[0].trim()&&(v.name=o[0].trim()),_&&([,v.email]=_),d&&([,v.url]=d),v};t.parsePerson=T;const G=n=>(A(n,V),A(n,T),n);t.fixPerson=G;const E=(n,o=!0)=>{if(Array.isArray(n.interfaces)||(n.interfaces=[]),n.interfaces.length)return n.interfaces.forEach(y=>{y.type===c.BLOCKLET_INTERFACE_TYPE_WEB&&(y.protocol="http")}),n;const _=(0,a.default)(n,"capabilities.dynamicPathPrefix",!0)?c.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",v=({type:y="web",name:Y,path:tt="/",protocol:et="http",port:it=c.BLOCKLET_DEFAULT_PORT_NAME})=>{n.interfaces.push({type:y,name:Y,path:tt,prefix:_,port:it,protocol:et})};return[c.BLOCKLET_INTERFACE_PUBLIC].forEach(y=>{n[y]&&v({name:y,path:n[y]})}),Array.isArray(n.exposeServices)&&n.exposeServices.forEach(y=>{v({type:"service",name:y.protocol,protocol:y.protocol,port:{internal:`BLOCKLET_${y.protocol}_PORT`.toUpperCase(),external:y.port}})}),o&&(delete n.publicUrl,delete n.adminUrl,delete n.configUrl,delete n.docUrl,delete n.exposeServices,n.capabilities&&delete n.capabilities.dynamicPathPrefix),n};t.fixInterfaces=E;const z=n=>{const{did:o}=n;try{(0,x.validateNewDid)(o),n.name=o}catch{}return n};t.fixName=z,t.default={fixRequired:f,fixRepository:S,fixFiles:h,fixKeywords:H,fixPerson:G,fixTags:C,fixName:z,formatPerson:V,parsePerson:T,fixInterfaces:E,fixService:g.fixAndValidateService}})(_t);function Tt({owner:t,locale:e}){return m.jsxs(qt,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.fullName,t.did?m.jsx(Kt,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:t.did,compact:!0,size:14,locale:e}):null]})}Tt.propTypes={owner:U.object.isRequired,locale:U.string.isRequired};function Dt({defaultUrl:t,onCancel:e,onSuccess:i,onError:r,mode:s,handleText:a}){const{api:p}=Vt(),{api:c}=zt(),[g,x]=D.useState(!1),[f,S]=D.useState(""),{t:h,locale:H}=Yt(),C={dist:{}},[A,V]=D.useState(t),[T,G]=D.useState(t?1:0),[E,z]=D.useState(C),[n,o]=D.useState(!1),[d,_]=D.useState({}),v=s==="component",y=v?!0:!t,Y=async()=>{z(C),S(null),x(!0);try{const u=decodeURIComponent(A.trim());try{new URL(u)}catch{throw new Error("Invalid URL")}const{meta:rt,inStore:Nt,registryUrl:$t}=await p.getBlockletMetaFromUrl({input:{url:u}});z(rt),_({inStore:Nt,registryUrl:$t,inputUrl:A.trim()})}catch(u){console.error(u);const rt=`Blocklet Install failed: ${re(u)}`;S(rt),r(u)}finally{x(!1)}},tt=()=>{if(v){i({meta:E,...d}),e();return}x(!0),o(!0)},et=()=>{x(!1),o(!1),i({meta:E,...d}),e()},it=()=>{x(!1),o(!1)};D.useEffect(()=>{t&&Y()},[t]);const Lt=[{name:h("common.name"),value:Xt.getDisplayName({meta:E},!0)},{name:h("common.version"),value:E.version},{name:h("common.did"),value:m.jsx(Jt,{did:E.did})},{name:h("common.author"),value:E.owner?m.jsx(Tt,{owner:E.owner,locale:H}):_t.formatPerson(E.author)},{name:h("blocklet.dist.downloadLink"),value:E.dist.tarball}],Mt=()=>g?m.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:m.jsx(pt,{})}):E.did?m.jsx("div",{style:{paddingLeft:"10%"},children:Lt.map(u=>u.name===h("common.did")?m.jsx(mt,{valueComponent:"div",nameWidth:120,name:u.name,nameFormatter:()=>h("common.did"),children:u.value},u.name):m.jsx(mt,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.name))}):null,ut=[{label:h("blocklet.fromUrl.step0"),body:m.jsx(Qt,{component:"div",children:m.jsx(oe,{label:h("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,style:{marginBottom:32},margin:"dense",helperText:h("blocklet.fromUrl.description"),value:A,onChange:u=>{S(null),V(u.target.value)},disabled:g,onKeyPress:u=>{u.key==="Enter"&&(u.preventDefault(),Y(),G(1))}})}),cancel:h("common.cancel"),confirm:h("common.next"),onCancel:e,onConfirm:()=>{Y(),G(1)}},{label:h("blocklet.fromUrl.step1"),body:Mt(),cancel:h(y?"common.pre":"common.cancel"),confirm:(a==null?void 0:a.confirm)||h("blocklet.fromUrl.confirm"),onCancel:()=>{y?G(u=>u-1):e()},onConfirm:()=>{tt()}}],L=ut[T];return m.jsxs(m.Fragment,{children:[m.jsxs(Zt,{title:(a==null?void 0:a.title)||h("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>L.onCancel(),showCloseButton:T===0,disableEscapeKeyDown:!0,open:!0,actions:m.jsxs(m.Fragment,{children:[L.cancel&&m.jsx(ft,{onClick:u=>{u.stopPropagation(),S(null),L.onCancel()},color:"inherit",children:L.cancel||h("common.cancel")}),m.jsxs(ft,{onClick:u=>{u.stopPropagation(),L.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:g||!A||f,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[g&&T===0&&m.jsx(pt,{size:16}),L.confirm]})]}),children:[y&&m.jsx(ae,{alternativeLabel:!0,activeStep:T,children:ut.map(({label:u})=>m.jsx(le,{children:m.jsx(he,{children:u})},u))}),m.jsx(kt,{component:"div",style:{marginTop:24},children:L.body}),!!f&&m.jsx(te,{severity:"error",style:{width:"100%",marginTop:8},children:f})]}),E&&n&&m.jsx(ee,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:c.get,checkTimeout:5*60*1e3,onSuccess:et,extraParams:{title:E.title,wt:ie(E),blockletMetaUrl:decodeURIComponent(A.trim())},messages:{title:h("setup.keyPair.title"),scan:h("setup.keyPair.scan"),confirm:h("setup.keyPair.confirm"),success:h("setup.keyPair.success")},onClose:it})]})}Dt.propTypes={defaultUrl:U.string,onCancel:U.func.isRequired,onSuccess:U.func.isRequired,onError:U.func,mode:U.oneOf(["install","component"]),handleText:U.object};Dt.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};export{ce as B,Dt as I,Tt as a,_t as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bJ as $,j as i,P as r,n as f,r as m,f as q,D as H,t as j,v as U,aO as E,cz as F,ch as P,q as M,cA as O,cB as B,cC as V,cp as J,cD as S,cE as N,as as z,Q as L,cg as W,C as X}from"./index-
|
|
1
|
+
import{bJ as $,j as i,P as r,n as f,r as m,f as q,D as H,t as j,v as U,aO as E,cz as F,ch as P,q as M,cA as O,cB as B,cC as V,cp as J,cD as S,cE as N,as as z,Q as L,cg as W,C as X}from"./index-DzlR4ROA.js";import{R as Q}from"./index-CkbP6S_A.js";import{C as A}from"./index-CveYHk3t.js";import{b as Y}from"./sdk-aTAcQDv-.js";import{d as G}from"./CheckCircle-DE_y9vib.js";import{w as K}from"./wrap-locale-CCm3KObK.js";const Z=$(i.jsx("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2m0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19z"}),"Inbox");function b({invitation:e,createPassportSvg:a,passportColor:c}){const[p,o]=m.useState(!1),{t}=m.useContext(q),l=m.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),u=m.useMemo(()=>a({title:l,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c}),[e,l]),x=m.useCallback(()=>{o(!0)},[]),s=m.useCallback(()=>{o(!1)},[]);return i.jsxs(i.Fragment,{children:[i.jsx(ee,{children:i.jsx("div",{className:"invite-passport__card",onClick:x,children:i.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:u}})})}),i.jsx(H,{open:p,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:s,children:e.role.permissions&&e.role.permissions.length>0?i.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(n=>i.jsx("li",{style:{listStyle:"circle"},children:n.description},n.name))}):i.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[i.jsx(Z,{style:{width:"30px",height:"30px"}}),i.jsx("div",{children:t("invite.emptyPermission")})]})})]})}b.propTypes={invitation:r.object.isRequired,createPassportSvg:r.func.isRequired,passportColor:r.string};b.defaultProps={passportColor:"auto"};const ee=f.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
max-width: 350px;
|
|
4
4
|
margin: 30px auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aK as i,aL as o,j as s,g as u,fl as f}from"./index-
|
|
1
|
+
import{aK as i,aL as o,j as s,g as u,fl as f}from"./index-DzlR4ROA.js";var e={},l=o;Object.defineProperty(e,"__esModule",{value:!0});var n=e.default=void 0,v=l(i()),d=s;n=e.default=(0,v.default)((0,d.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined");const a=f;var x=(t,r)=>a(t)===a(r);const h=u(x);export{n as d,h as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as r,eS as t}from"./index-
|
|
1
|
+
import{g as r,eS as t}from"./index-DzlR4ROA.js";var u=t;function e(a,s){return u(a,s)}var o=e;const l=r(o);export{o as a,l as i};
|