@shiftengineering/folio 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -0
- package/dist-embed-component/Folio Tutorial.pdf +0 -0
- package/dist-embed-component/apple-touch-icon-180x180.png +0 -0
- package/dist-embed-component/apple-touch-icon.png +0 -0
- package/dist-embed-component/favicon-96x96.png +0 -0
- package/dist-embed-component/favicon.ico +0 -0
- package/dist-embed-component/favicon.svg +15 -0
- package/dist-embed-component/folio-embed.js +2259 -0
- package/dist-embed-component/folio-embed.umd.cjs +34 -0
- package/dist-embed-component/folio-light.svg +11 -0
- package/dist-embed-component/folio.svg +11 -0
- package/dist-embed-component/logo-dev.svg +6 -0
- package/dist-embed-component/logo.svg +13 -0
- package/dist-embed-component/maskable-icon-512x512.png +0 -0
- package/dist-embed-component/nvidia-10k-2023.pdf +0 -0
- package/dist-embed-component/nvidia-10k-2024.pdf +0 -0
- package/dist-embed-component/pwa-192x192.png +0 -0
- package/dist-embed-component/pwa-512x512.png +0 -0
- package/dist-embed-component/pwa-64x64.png +0 -0
- package/dist-embed-component/shift-text-black.svg +3 -0
- package/dist-embed-component/shift-text-white.svg +3 -0
- package/dist-embed-component/site.webmanifest +21 -0
- package/dist-embed-component/staticwebapp.config.json +6 -0
- package/dist-embed-component/types/embed-component/FolioContext.d.ts +62 -0
- package/dist-embed-component/types/embed-component/FolioEmbed.component.d.ts +28 -0
- package/dist-embed-component/types/embed-component/index.d.ts +3 -0
- package/dist-embed-component/types/embed-component/useFolio.d.ts +32 -0
- package/dist-embed-component/web-app-manifest-192x192.png +0 -0
- package/dist-embed-component/web-app-manifest-512x512.png +0 -0
- package/package.json +204 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
(function(F,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],j):(F=typeof globalThis<"u"?globalThis:F||self,j(F.FolioEmbedComponent={},F.React))})(this,function(F,j){"use strict";var ut,ct,lt,ft,dt,mt;function Vt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const $t=Vt(j);var le={exports:{}},Y={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var je;function zt(){if(je)return Y;je=1;var e=j,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(l,a,f){var m,p={},h=null,w=null;f!==void 0&&(h=""+f),a.key!==void 0&&(h=""+a.key),a.ref!==void 0&&(w=a.ref);for(m in a)n.call(a,m)&&!s.hasOwnProperty(m)&&(p[m]=a[m]);if(l&&l.defaultProps)for(m in a=l.defaultProps,a)p[m]===void 0&&(p[m]=a[m]);return{$$typeof:t,type:l,key:h,ref:w,props:p,_owner:i.current}}return Y.Fragment=r,Y.jsx=u,Y.jsxs=u,Y}var H={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ce;function Mt(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var e=j,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),x=Symbol.iterator,P="@@iterator";function W(o){if(o===null||typeof o!="object")return null;var c=x&&o[x]||o[P];return typeof c=="function"?c:null}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(o){{for(var c=arguments.length,d=new Array(c>1?c-1:0),y=1;y<c;y++)d[y-1]=arguments[y];yn("error",o,d)}}function yn(o,c,d){{var y=A.ReactDebugCurrentFrame,E=y.getStackAddendum();E!==""&&(c+="%s",d=d.concat([E]));var R=d.map(function(v){return String(v)});R.unshift("Warning: "+c),Function.prototype.apply.call(console[o],console,R)}}var hn=!1,gn=!1,bn=!1,wn=!1,vn=!1,pt;pt=Symbol.for("react.module.reference");function En(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===s||vn||o===i||o===f||o===m||wn||o===w||hn||gn||bn||typeof o=="object"&&o!==null&&(o.$$typeof===h||o.$$typeof===p||o.$$typeof===u||o.$$typeof===l||o.$$typeof===a||o.$$typeof===pt||o.getModuleId!==void 0))}function Pn(o,c,d){var y=o.displayName;if(y)return y;var E=c.displayName||c.name||"";return E!==""?d+"("+E+")":d}function yt(o){return o.displayName||"Context"}function L(o){if(o==null)return null;if(typeof o.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case m:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var c=o;return yt(c)+".Consumer";case u:var d=o;return yt(d._context)+".Provider";case a:return Pn(o,o.render,"ForwardRef");case p:var y=o.displayName||null;return y!==null?y:L(o.type)||"Memo";case h:{var E=o,R=E._payload,v=E._init;try{return L(v(R))}catch{return null}}}return null}var V=Object.assign,ee=0,ht,gt,bt,wt,vt,Et,Pt;function Rt(){}Rt.__reactDisabledLog=!0;function Rn(){{if(ee===0){ht=console.log,gt=console.info,bt=console.warn,wt=console.error,vt=console.group,Et=console.groupCollapsed,Pt=console.groupEnd;var o={configurable:!0,enumerable:!0,value:Rt,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}ee++}}function Tn(){{if(ee--,ee===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},o,{value:ht}),info:V({},o,{value:gt}),warn:V({},o,{value:bt}),error:V({},o,{value:wt}),group:V({},o,{value:vt}),groupCollapsed:V({},o,{value:Et}),groupEnd:V({},o,{value:Pt})})}ee<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Pe=A.ReactCurrentDispatcher,Re;function se(o,c,d){{if(Re===void 0)try{throw Error()}catch(E){var y=E.stack.trim().match(/\n( *(at )?)/);Re=y&&y[1]||""}return`
|
|
18
|
+
`+Re+o}}var Te=!1,ae;{var On=typeof WeakMap=="function"?WeakMap:Map;ae=new On}function Tt(o,c){if(!o||Te)return"";{var d=ae.get(o);if(d!==void 0)return d}var y;Te=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=Pe.current,Pe.current=null,Rn();try{if(c){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(k){y=k}Reflect.construct(o,[],v)}else{try{v.call()}catch(k){y=k}o.call(v.prototype)}}else{try{throw Error()}catch(k){y=k}o()}}catch(k){if(k&&y&&typeof k.stack=="string"){for(var g=k.stack.split(`
|
|
19
|
+
`),_=y.stack.split(`
|
|
20
|
+
`),T=g.length-1,O=_.length-1;T>=1&&O>=0&&g[T]!==_[O];)O--;for(;T>=1&&O>=0;T--,O--)if(g[T]!==_[O]){if(T!==1||O!==1)do if(T--,O--,O<0||g[T]!==_[O]){var C=`
|
|
21
|
+
`+g[T].replace(" at new "," at ");return o.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",o.displayName)),typeof o=="function"&&ae.set(o,C),C}while(T>=1&&O>=0);break}}}finally{Te=!1,Pe.current=R,Tn(),Error.prepareStackTrace=E}var K=o?o.displayName||o.name:"",$=K?se(K):"";return typeof o=="function"&&ae.set(o,$),$}function Sn(o,c,d){return Tt(o,!1)}function xn(o){var c=o.prototype;return!!(c&&c.isReactComponent)}function ue(o,c,d){if(o==null)return"";if(typeof o=="function")return Tt(o,xn(o));if(typeof o=="string")return se(o);switch(o){case f:return se("Suspense");case m:return se("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case a:return Sn(o.render);case p:return ue(o.type,c,d);case h:{var y=o,E=y._payload,R=y._init;try{return ue(R(E),c,d)}catch{}}}return""}var te=Object.prototype.hasOwnProperty,Ot={},St=A.ReactDebugCurrentFrame;function ce(o){if(o){var c=o._owner,d=ue(o.type,o._source,c?c.type:null);St.setExtraStackFrame(d)}else St.setExtraStackFrame(null)}function _n(o,c,d,y,E){{var R=Function.call.bind(te);for(var v in o)if(R(o,v)){var g=void 0;try{if(typeof o[v]!="function"){var _=Error((y||"React class")+": "+d+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _.name="Invariant Violation",_}g=o[v](c,v,y,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(T){g=T}g&&!(g instanceof Error)&&(ce(E),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",y||"React class",d,v,typeof g),ce(null)),g instanceof Error&&!(g.message in Ot)&&(Ot[g.message]=!0,ce(E),S("Failed %s type: %s",d,g.message),ce(null))}}}var kn=Array.isArray;function Oe(o){return kn(o)}function jn(o){{var c=typeof Symbol=="function"&&Symbol.toStringTag,d=c&&o[Symbol.toStringTag]||o.constructor.name||"Object";return d}}function Cn(o){try{return xt(o),!1}catch{return!0}}function xt(o){return""+o}function _t(o){if(Cn(o))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jn(o)),xt(o)}var kt=A.ReactCurrentOwner,An={key:!0,ref:!0,__self:!0,__source:!0},jt,Ct;function In(o){if(te.call(o,"ref")){var c=Object.getOwnPropertyDescriptor(o,"ref").get;if(c&&c.isReactWarning)return!1}return o.ref!==void 0}function Fn(o){if(te.call(o,"key")){var c=Object.getOwnPropertyDescriptor(o,"key").get;if(c&&c.isReactWarning)return!1}return o.key!==void 0}function Dn(o,c){typeof o.ref=="string"&&kt.current}function Nn(o,c){{var d=function(){jt||(jt=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",c))};d.isReactWarning=!0,Object.defineProperty(o,"key",{get:d,configurable:!0})}}function Ln(o,c){{var d=function(){Ct||(Ct=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",c))};d.isReactWarning=!0,Object.defineProperty(o,"ref",{get:d,configurable:!0})}}var Un=function(o,c,d,y,E,R,v){var g={$$typeof:t,type:o,key:c,ref:d,props:v,_owner:R};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function Vn(o,c,d,y,E){{var R,v={},g=null,_=null;d!==void 0&&(_t(d),g=""+d),Fn(c)&&(_t(c.key),g=""+c.key),In(c)&&(_=c.ref,Dn(c,E));for(R in c)te.call(c,R)&&!An.hasOwnProperty(R)&&(v[R]=c[R]);if(o&&o.defaultProps){var T=o.defaultProps;for(R in T)v[R]===void 0&&(v[R]=T[R])}if(g||_){var O=typeof o=="function"?o.displayName||o.name||"Unknown":o;g&&Nn(v,O),_&&Ln(v,O)}return Un(o,g,_,E,y,kt.current,v)}}var Se=A.ReactCurrentOwner,At=A.ReactDebugCurrentFrame;function B(o){if(o){var c=o._owner,d=ue(o.type,o._source,c?c.type:null);At.setExtraStackFrame(d)}else At.setExtraStackFrame(null)}var xe;xe=!1;function _e(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function It(){{if(Se.current){var o=L(Se.current.type);if(o)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+o+"`."}return""}}function $n(o){return""}var Ft={};function zn(o){{var c=It();if(!c){var d=typeof o=="string"?o:o.displayName||o.name;d&&(c=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+d+">.")}return c}}function Dt(o,c){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var d=zn(c);if(Ft[d])return;Ft[d]=!0;var y="";o&&o._owner&&o._owner!==Se.current&&(y=" It was passed a child from "+L(o._owner.type)+"."),B(o),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',d,y),B(null)}}function Nt(o,c){{if(typeof o!="object")return;if(Oe(o))for(var d=0;d<o.length;d++){var y=o[d];_e(y)&&Dt(y,c)}else if(_e(o))o._store&&(o._store.validated=!0);else if(o){var E=W(o);if(typeof E=="function"&&E!==o.entries)for(var R=E.call(o),v;!(v=R.next()).done;)_e(v.value)&&Dt(v.value,c)}}}function Mn(o){{var c=o.type;if(c==null||typeof c=="string")return;var d;if(typeof c=="function")d=c.propTypes;else if(typeof c=="object"&&(c.$$typeof===a||c.$$typeof===p))d=c.propTypes;else return;if(d){var y=L(c);_n(d,o.props,"prop",y,o)}else if(c.PropTypes!==void 0&&!xe){xe=!0;var E=L(c);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof c.getDefaultProps=="function"&&!c.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function qn(o){{for(var c=Object.keys(o.props),d=0;d<c.length;d++){var y=c[d];if(y!=="children"&&y!=="key"){B(o),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",y),B(null);break}}o.ref!==null&&(B(o),S("Invalid attribute `ref` supplied to `React.Fragment`."),B(null))}}var Lt={};function Ut(o,c,d,y,E,R){{var v=En(o);if(!v){var g="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(g+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var _=$n();_?g+=_:g+=It();var T;o===null?T="null":Oe(o)?T="array":o!==void 0&&o.$$typeof===t?(T="<"+(L(o.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):T=typeof o,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",T,g)}var O=Vn(o,c,d,E,R);if(O==null)return O;if(v){var C=c.children;if(C!==void 0)if(y)if(Oe(C)){for(var K=0;K<C.length;K++)Nt(C[K],o);Object.freeze&&Object.freeze(C)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Nt(C,o)}if(te.call(c,"key")){var $=L(o),k=Object.keys(c).filter(function(Gn){return Gn!=="key"}),ke=k.length>0?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}";if(!Lt[$+ke]){var Hn=k.length>0?"{"+k.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,ke,$,Hn,$),Lt[$+ke]=!0}}return o===n?qn(O):Mn(O),O}}function Wn(o,c,d){return Ut(o,c,d,!0)}function Bn(o,c,d){return Ut(o,c,d,!1)}var Kn=Bn,Yn=Wn;H.Fragment=n,H.jsx=Kn,H.jsxs=Yn}()),H}process.env.NODE_ENV==="production"?le.exports=zt():le.exports=Mt();var fe=le.exports,de=(e=>(e.PDF="application/pdf",e.TXT="text/plain",e.CSV="text/csv",e))(de||{});const me=4e3*1024*1024;Object.entries({"application/pdf":{extensions:[".pdf"],maxSize:me},"text/plain":{extensions:[".txt",".json",".py",".ts",".tsx"],maxSize:me},"text/csv":{extensions:[".csv"],maxSize:me}}).reduce((e,[t,r])=>({...e,[t]:r.extensions}),{}),new Set(Object.values(de));function z(e){const t={subscribe(r){let n=null,i=!1,s=!1,u=!1;function l(){if(n===null){u=!0;return}s||(s=!0,typeof n=="function"?n():n&&n.unsubscribe())}return n=e({next(a){var f;i||(f=r.next)==null||f.call(r,a)},error(a){var f;i||(i=!0,(f=r.error)==null||f.call(r,a),l())},complete(){var a;i||(i=!0,(a=r.complete)==null||a.call(r),l())}}),u&&l(),{unsubscribe:l}},pipe(...r){return r.reduce(qt,t)}};return t}function qt(e,t){return t(e)}function Wt(e){const t=new AbortController;return new Promise((n,i)=>{let s=!1;function u(){s||(s=!0,l.unsubscribe())}t.signal.addEventListener("abort",()=>{i(t.signal.reason)});const l=e.subscribe({next(a){s=!0,n(a),u()},error(a){i(a)},complete(){t.abort(),u()}})})}function Bt(e){return t=>{let r=0,n=null;const i=[];function s(){n||(n=t.subscribe({next(l){var a;for(const f of i)(a=f.next)==null||a.call(f,l)},error(l){var a;for(const f of i)(a=f.error)==null||a.call(f,l)},complete(){var l;for(const a of i)(l=a.complete)==null||l.call(a)}}))}function u(){if(r===0&&n){const l=n;n=null,l.unsubscribe()}}return z(l=>(r++,i.push(l),s(),{unsubscribe(){r--,u();const a=i.findIndex(f=>f===l);a>-1&&i.splice(a,1)}}))}}function Kt(e){return t=>z(r=>t.subscribe({next(n){var i;(i=e.next)==null||i.call(e,n),r.next(n)},error(n){var i;(i=e.error)==null||i.call(e,n),r.error(n)},complete(){var n;(n=e.complete)==null||n.call(e),r.complete()}}))}function Yt(e){let t=e;const r=[],n=u=>{t!==void 0&&u.next(t),r.push(u)},i=u=>{r.splice(r.indexOf(u),1)},s=z(u=>(n(u),()=>{i(u)}));return s.next=u=>{if(t!==u){t=u;for(const l of r)l.next(u)}},s.get=()=>t,s}function Ht(e){return z(t=>{function r(i=0,s=e.op){const u=e.links[i];if(!u)throw new Error("No more links to execute - did you forget to add an ending link?");return u({op:s,next(a){return r(i+1,a)}})}return r().subscribe(t)})}const Ae=()=>{},Ie=e=>{Object.freeze&&Object.freeze(e)};function Fe(e,t,r){var n,i;const s=t.join(".");return(n=r)[i=s]??(n[i]=new Proxy(Ae,{get(u,l){if(!(typeof l!="string"||l==="then"))return Fe(e,[...t,l],r)},apply(u,l,a){const f=t[t.length-1];let m={args:a,path:t};return f==="call"?m={args:a.length>=2?[a[1]]:[],path:t.slice(0,-1)}:f==="apply"&&(m={args:a.length>=2?a[1]:[],path:t.slice(0,-1)}),Ie(m.args),Ie(m.path),e(m)}})),r[s]}const Gt=e=>Fe(e,[],Object.create(null)),Xt=e=>new Proxy(Ae,{get(t,r){if(r!=="then")return e(r)}});function G(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Jt(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:{...e,error:n}}}return{ok:!0,result:{...e.result,...(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)}}}}class pe extends Error{constructor(){super("Unable to transform response from server")}}function Zt(e,t){let r;try{r=Jt(e,t)}catch{throw new pe}if(!r.ok&&(!G(r.error.error)||typeof r.error.error.code!="number"))throw new pe;if(r.ok&&!G(r.result))throw new pe;return r}var De,Ne;(De=Symbol).dispose??(De.dispose=Symbol()),(Ne=Symbol).asyncDispose??(Ne.asyncDispose=Symbol()),typeof window>"u"||"Deno"in window||((ct=(ut=globalThis.process)==null?void 0:ut.env)==null?void 0:ct.NODE_ENV)==="test"||(ft=(lt=globalThis.process)==null?void 0:lt.env)!=null&&ft.JEST_WORKER_ID||(mt=(dt=globalThis.process)==null?void 0:dt.env)!=null&&mt.VITEST_WORKER_ID;function re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qt(e){return e instanceof D||e instanceof Error&&e.name==="TRPCClientError"}function er(e){return G(e)&&G(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function tr(e,t){return typeof e=="string"?e:G(e)&&typeof e.message=="string"?e.message:t}class D extends Error{static from(t,r={}){const n=t;return Qt(n)?(r.meta&&(n.meta={...n.meta,...r.meta}),n):er(n)?new D(n.error.message,{...r,result:n}):new D(tr(n,"Unknown error"),{...r,cause:n})}constructor(t,r){var i,s;const n=r==null?void 0:r.cause;super(t,{cause:n}),re(this,"cause",void 0),re(this,"shape",void 0),re(this,"data",void 0),re(this,"meta",void 0),this.meta=r==null?void 0:r.meta,this.cause=n,this.shape=(i=r==null?void 0:r.result)==null?void 0:i.error,this.data=(s=r==null?void 0:r.result)==null?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,D.prototype)}}function ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class rr{$request(t){return Ht({links:this.links,op:{...t,context:t.context??{},id:++this.requestId}}).pipe(Bt())}async requestAsPromise(t){try{const r=this.$request(t);return(await Wt(r)).result.data}catch(r){throw D.from(r)}}query(t,r,n){return this.requestAsPromise({type:"query",path:t,input:r,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(t,r,n){return this.requestAsPromise({type:"mutation",path:t,input:r,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(t,r,n){return this.$request({type:"subscription",path:t,input:r,context:n.context,signal:n.signal}).subscribe({next(s){var u,l,a,f;switch(s.result.type){case"state":{(u=n.onConnectionStateChange)==null||u.call(n,s.result);break}case"started":{(l=n.onStarted)==null||l.call(n,{context:s.context});break}case"stopped":{(a=n.onStopped)==null||a.call(n);break}case"data":case void 0:{(f=n.onData)==null||f.call(n,s.result.data);break}}},error(s){var u;(u=n.onError)==null||u.call(n,s)},complete(){var s;(s=n.onComplete)==null||s.call(n)}})}constructor(t){ye(this,"links",void 0),ye(this,"runtime",void 0),ye(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(r=>r(this.runtime))}}const nr=Symbol.for("trpc_untypedClient"),or={query:"query",mutate:"mutation",subscribe:"subscription"},ir=e=>or[e];function sr(e){const t=Gt(({path:r,args:n})=>{const i=[...r],s=ir(i.pop()),u=i.join(".");return e[s](u,...n)});return Xt(r=>r===nr?e:t[r])}function ar(e){const t=new rr(e);return sr(t)}const Le=e=>typeof e=="function";function ur(e){if(e)return e;if(typeof window<"u"&&Le(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Le(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const Ue=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Ve(e){let t=null,r=null;const n=()=>{clearTimeout(r),r=null,t=null};function i(l){var m,p;const a=[[]];let f=0;for(;;){const h=l[f];if(!h)break;const w=a[a.length-1];if(h.aborted){(m=h.reject)==null||m.call(h,new Error("Aborted")),f++;continue}if(e.validate(w.concat(h).map(P=>P.key))){w.push(h),f++;continue}if(w.length===0){(p=h.reject)==null||p.call(h,new Error("Input is too big for a single dispatch")),f++;continue}a.push([])}return a}function s(){const l=i(t);n();for(const a of l){if(!a.length)continue;const f={items:a};for(const p of a)p.batch=f;e.fetch(f.items.map(p=>p.key)).then(async p=>{var h;await Promise.all(p.map(async(w,x)=>{var W,A;const P=f.items[x];try{const S=await Promise.resolve(w);(W=P.resolve)==null||W.call(P,S)}catch(S){(A=P.reject)==null||A.call(P,S)}P.batch=null,P.reject=null,P.resolve=null}));for(const w of f.items)(h=w.reject)==null||h.call(w,new Error("Missing result")),w.batch=null}).catch(p=>{var h;for(const w of f.items)(h=w.reject)==null||h.call(w,p),w.batch=null})}}function u(l){const a={aborted:!1,key:l,batch:null,resolve:Ue,reject:Ue},f=new Promise((m,p)=>{a.reject=p,a.resolve=m,t||(t=[]),t.push(a)});return r||(r=setTimeout(s)),f}return{load:u}}function cr(...e){const t=new AbortController,r=e.length;let n=0;const i=()=>{++n===r&&t.abort()};for(const s of e)s!=null&&s.aborted?i():s==null||s.addEventListener("abort",i,{once:!0});return t.signal}function lr(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:r=>r,deserialize:r=>r},output:{serialize:r=>r,deserialize:r=>r}}}function fr(e){return{url:e.url.toString(),fetch:e.fetch,transformer:lr(e.transformer),methodOverride:e.methodOverride}}function dr(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[r]=n}return t}const mr={query:"GET",mutation:"POST",subscription:"PATCH"};function $e(e){return"input"in e?e.transformer.input.serialize(e.input):dr(e.inputs.map(t=>e.transformer.input.serialize(t)))}const ze=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const i=[];if(t[1]&&i.push(t[1]),"inputs"in e&&i.push("batch=1"),e.type==="query"||e.type==="subscription"){const s=$e(e);s!==void 0&&e.methodOverride!=="POST"&&i.push(`input=${encodeURIComponent(JSON.stringify(s))}`)}return i.length&&(n+="?"+i.join("&")),n},pr=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=$e(e);return t!==void 0?JSON.stringify(t):void 0},yr=e=>wr({...e,contentTypeHeader:"application/json",getUrl:ze,getBody:pr});class hr extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}}const gr=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new hr};async function br(e){gr(e.signal);const t=e.getUrl(e),r=e.getBody(e),{type:n}=e,i=await(async()=>{const u=await e.headers();return Symbol.iterator in u?Object.fromEntries(u):u})(),s={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...i};return ur(e.fetch)(t,{method:e.methodOverride??mr[n],signal:e.signal,body:r,headers:s})}async function wr(e){const t={},r=await br(e);t.response=r;const n=await r.json();return t.responseJSON=n,{json:n,meta:t}}function vr(e){const t=fr(e),r=e.maxURLLength??1/0;return()=>{const n=l=>({validate(a){if(r===1/0)return!0;const f=a.map(h=>h.path).join(","),m=a.map(h=>h.input);return ze({...t,type:l,path:f,inputs:m,signal:null}).length<=r},async fetch(a){const f=a.map(P=>P.path).join(","),m=a.map(P=>P.input),p=cr(...a.map(P=>P.signal)),h=await yr({...t,path:f,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:a}):e.headers:{}},signal:p});return(Array.isArray(h.json)?h.json:a.map(()=>h.json)).map(P=>({meta:h.meta,json:P}))}}),i=Ve(n("query")),s=Ve(n("mutation")),u={query:i,mutation:s};return({op:l})=>z(a=>{/* istanbul ignore if -- @preserve */if(l.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const m=u[l.type].load(l);let p;return m.then(h=>{p=h;const w=Zt(h.json,t.transformer.output);if(!w.ok){a.error(D.from(w.error,{meta:h.meta}));return}a.next({context:h.meta,result:w.result}),a.complete()}).catch(h=>{a.error(D.from(h,{meta:p==null?void 0:p.meta}))}),()=>{}})}}function Er(e){return typeof FormData>"u"?!1:e instanceof FormData}const he={css:{query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},ansi:{regular:{query:["\x1B[30;46m","\x1B[97;46m"],mutation:["\x1B[30;45m","\x1B[97;45m"],subscription:["\x1B[30;42m","\x1B[97;42m"]},bold:{query:["\x1B[1;30;46m","\x1B[1;97;46m"],mutation:["\x1B[1;30;45m","\x1B[1;97;45m"],subscription:["\x1B[1;30;42m","\x1B[1;97;42m"]}}};function Pr(e){const{direction:t,type:r,withContext:n,path:i,id:s,input:u}=e,l=[],a=[];if(e.colorMode==="none")l.push(t==="up"?">>":"<<",r,`#${s}`,i);else if(e.colorMode==="ansi"){const[f,m]=he.ansi.regular[r],[p,h]=he.ansi.bold[r];l.push(t==="up"?f:m,t==="up"?">>":"<<",r,t==="up"?p:h,`#${s}`,i,"\x1B[0m")}else{const[f,m]=he.css[r],p=`
|
|
31
|
+
background-color: #${t==="up"?f:m};
|
|
32
|
+
color: ${t==="up"?"black":"white"};
|
|
33
|
+
padding: 2px;
|
|
34
|
+
`;l.push("%c",t==="up"?">>":"<<",r,`#${s}`,`%c${i}%c`,"%O"),a.push(p,`${p}; font-weight: bold;`,`${p}; font-weight: normal;`)}return t==="up"?a.push(n?{input:u,context:e.context}:{input:u}):a.push({input:u,result:e.result,elapsedMs:e.elapsedMs,...n&&{context:e.context}}),{parts:l,args:a}}const Rr=({c:e=console,colorMode:t="css",withContext:r})=>n=>{const i=n.input,s=Er(i)?Object.fromEntries(i):i,{parts:u,args:l}=Pr({...n,colorMode:t,input:s,withContext:r}),a=n.direction==="down"&&n.result&&(n.result instanceof Error||"error"in n.result.result&&n.result.result.error)?"error":"log";e[a].apply(null,[u.join(" ")].concat(l))};function Tr(e={}){const{enabled:t=()=>!0}=e,r=e.colorMode??(typeof window>"u"?"ansi":"css"),n=e.withContext??r==="css",{logger:i=Rr({c:e.console,colorMode:r,withContext:n})}=e;return()=>({op:s,next:u})=>z(l=>{t({...s,direction:"up"})&&i({...s,direction:"up"});const a=Date.now();function f(m){const p=Date.now()-a;t({...s,direction:"down",result:m})&&i({...s,direction:"down",elapsedMs:p,result:m})}return u(s).pipe(Kt({next(m){f(m)},error(m){f(m)}})).subscribe(l)})}const Or=(e,...t)=>typeof e=="function"?e(...t):e;function Sr(){let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}async function xr(e){const t=await Or(e.url);if(!e.connectionParams)return t;const n=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+n}function U(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _r(e){const{promise:t,resolve:r,reject:n}=Sr();return e.addEventListener("open",()=>{e.removeEventListener("error",n),r()}),e.addEventListener("error",n),t}function kr(e,{intervalMs:t,pongTimeoutMs:r}){let n,i;function s(){n=setTimeout(()=>{e.send("PING"),i=setTimeout(()=>{e.close()},r)},t)}function u(){clearTimeout(n),s()}function l(){clearTimeout(i),u()}e.addEventListener("open",s),e.addEventListener("message",({data:a})=>{clearTimeout(n),s(),a==="PONG"&&l()}),e.addEventListener("close",()=>{clearTimeout(n),clearTimeout(i)})}class ne{get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++ne.connectCount;const t=xr(this.urlOptions).then(r=>new this.WebSocketPonyfill(r));this.openPromise=t.then(_r),this.ws=await t,this.ws.addEventListener("message",function({data:r}){r==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&kr(this.ws,this.keepAliveOpts),this.ws.addEventListener("close",()=>{this.ws=null});try{await this.openPromise}finally{this.openPromise=null}}async close(){var t;try{await this.openPromise}finally{(t=this.ws)==null||t.close()}}constructor(t){if(U(this,"id",++ne.connectCount),U(this,"WebSocketPonyfill",void 0),U(this,"urlOptions",void 0),U(this,"keepAliveOpts",void 0),U(this,"wsObservable",Yt(null)),U(this,"openPromise",null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}}U(ne,"connectCount",0);class jr{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,r){this.keyToValue.set(t,r),this.valueToKey.set(r,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class Me{constructor(t){this.generateIdentifier=t,this.kv=new jr}register(t,r){this.kv.getByValue(t)||(r||(r=this.generateIdentifier(t)),this.kv.set(r,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}}class Cr extends Me{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(t,r.allowProps),super.register(t,r.identifier)):super.register(t,r)}getAllowedProps(t){return this.classToAllowedProps.get(t)}}function Ar(e){if("values"in Object)return Object.values(e);const t=[];for(const r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}function Ir(e,t){const r=Ar(e);if("find"in r)return r.find(t);const n=r;for(let i=0;i<n.length;i++){const s=n[i];if(t(s))return s}}function M(e,t){Object.entries(e).forEach(([r,n])=>t(n,r))}function oe(e,t){return e.indexOf(t)!==-1}function qe(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(t(n))return n}}class Fr{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return Ir(this.transfomers,r=>r.isApplicable(t))}findByName(t){return this.transfomers[t]}}const Dr=e=>Object.prototype.toString.call(e).slice(8,-1),We=e=>typeof e>"u",Nr=e=>e===null,X=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,ge=e=>X(e)&&Object.keys(e).length===0,N=e=>Array.isArray(e),Lr=e=>typeof e=="string",Ur=e=>typeof e=="number"&&!isNaN(e),Vr=e=>typeof e=="boolean",$r=e=>e instanceof RegExp,J=e=>e instanceof Map,Z=e=>e instanceof Set,Be=e=>Dr(e)==="Symbol",zr=e=>e instanceof Date&&!isNaN(e.valueOf()),Mr=e=>e instanceof Error,Ke=e=>typeof e=="number"&&isNaN(e),qr=e=>Vr(e)||Nr(e)||We(e)||Ur(e)||Lr(e)||Be(e),Wr=e=>typeof e=="bigint",Br=e=>e===1/0||e===-1/0,Kr=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Yr=e=>e instanceof URL,Ye=e=>e.replace(/\./g,"\\."),be=e=>e.map(String).map(Ye).join("."),Q=e=>{const t=[];let r="";for(let i=0;i<e.length;i++){let s=e.charAt(i);if(s==="\\"&&e.charAt(i+1)==="."){r+=".",i++;continue}if(s==="."){t.push(r),r="";continue}r+=s}const n=r;return t.push(n),t};function I(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}const He=[I(We,"undefined",()=>null,()=>{}),I(Wr,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),I(zr,"Date",e=>e.toISOString(),e=>new Date(e)),I(Mr,"Error",(e,t)=>{const r={name:e.name,message:e.message};return t.allowedErrorProps.forEach(n=>{r[n]=e[n]}),r},(e,t)=>{const r=new Error(e.message);return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(n=>{r[n]=e[n]}),r}),I($r,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),r=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,r)}),I(Z,"set",e=>[...e.values()],e=>new Set(e)),I(J,"map",e=>[...e.entries()],e=>new Map(e)),I(e=>Ke(e)||Br(e),"number",e=>Ke(e)?"NaN":e>0?"Infinity":"-Infinity",Number),I(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),I(Yr,"URL",e=>e.toString(),e=>new URL(e))];function ie(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}const Ge=ie((e,t)=>Be(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,r)=>{const n=r.symbolRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),Hr=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),Xe=ie(Kr,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const r=Hr[t[1]];if(!r)throw new Error("Trying to deserialize unknown typed array");return new r(e)});function Je(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}const Ze=ie(Je,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return{...e};const n={};return r.forEach(i=>{n[i]=e[i]}),n},(e,t,r)=>{const n=r.classRegistry.getValue(t[1]);if(!n)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(n.prototype),e)}),Qe=ie((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,r)=>{const n=r.customTransformerRegistry.findByName(t[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(e)}),Gr=[Ze,Ge,Qe,Xe],et=(e,t)=>{const r=qe(Gr,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};const n=qe(He,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation}},tt={};He.forEach(e=>{tt[e.annotation]=e});const Xr=(e,t,r)=>{if(N(t))switch(t[0]){case"symbol":return Ge.untransform(e,t,r);case"class":return Ze.untransform(e,t,r);case"custom":return Qe.untransform(e,t,r);case"typed-array":return Xe.untransform(e,t,r);default:throw new Error("Unknown transformation: "+t)}else{const n=tt[t];if(!n)throw new Error("Unknown transformation: "+t);return n.untransform(e,r)}},q=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const r=e.keys();for(;t>0;)r.next(),t--;return r.next().value};function rt(e){if(oe(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(oe(e,"prototype"))throw new Error("prototype is not allowed as a property");if(oe(e,"constructor"))throw new Error("constructor is not allowed as a property")}const Jr=(e,t)=>{rt(t);for(let r=0;r<t.length;r++){const n=t[r];if(Z(e))e=q(e,+n);else if(J(e)){const i=+n,s=+t[++r]==0?"key":"value",u=q(e,i);switch(s){case"key":e=u;break;case"value":e=e.get(u);break}}else e=e[n]}return e},we=(e,t,r)=>{if(rt(t),t.length===0)return r(e);let n=e;for(let s=0;s<t.length-1;s++){const u=t[s];if(N(n)){const l=+u;n=n[l]}else if(X(n))n=n[u];else if(Z(n)){const l=+u;n=q(n,l)}else if(J(n)){if(s===t.length-2)break;const a=+u,f=+t[++s]==0?"key":"value",m=q(n,a);switch(f){case"key":n=m;break;case"value":n=n.get(m);break}}}const i=t[t.length-1];if(N(n)?n[+i]=r(n[+i]):X(n)&&(n[i]=r(n[i])),Z(n)){const s=q(n,+i),u=r(s);s!==u&&(n.delete(s),n.add(u))}if(J(n)){const s=+t[t.length-2],u=q(n,s);switch(+i==0?"key":"value"){case"key":{const a=r(u);n.set(a,n.get(u)),a!==u&&n.delete(u);break}case"value":{n.set(u,r(n.get(u)));break}}}return e};function ve(e,t,r=[]){if(!e)return;if(!N(e)){M(e,(s,u)=>ve(s,t,[...r,...Q(u)]));return}const[n,i]=e;i&&M(i,(s,u)=>{ve(s,t,[...r,...Q(u)])}),t(n,r)}function Zr(e,t,r){return ve(t,(n,i)=>{e=we(e,i,s=>Xr(s,n,r))}),e}function Qr(e,t){function r(n,i){const s=Jr(e,Q(i));n.map(Q).forEach(u=>{e=we(e,u,()=>s)})}if(N(t)){const[n,i]=t;n.forEach(s=>{e=we(e,Q(s),()=>e)}),i&&M(i,r)}else M(t,r);return e}const en=(e,t)=>X(e)||N(e)||J(e)||Z(e)||Je(e,t);function tn(e,t,r){const n=r.get(e);n?n.push(t):r.set(e,[t])}function rn(e,t){const r={};let n;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(l=>l.map(String)).sort((l,a)=>l.length-a.length));const[s,...u]=i;s.length===0?n=u.map(be):r[be(s)]=u.map(be)}),n?ge(r)?[n]:[n,r]:ge(r)?void 0:r}const nt=(e,t,r,n,i=[],s=[],u=new Map)=>{const l=qr(e);if(!l){tn(e,i,t);const w=u.get(e);if(w)return n?{transformedValue:null}:w}if(!en(e,r)){const w=et(e,r),x=w?{transformedValue:w.value,annotations:[w.type]}:{transformedValue:e};return l||u.set(e,x),x}if(oe(s,e))return{transformedValue:null};const a=et(e,r),f=(a==null?void 0:a.value)??e,m=N(f)?[]:{},p={};M(f,(w,x)=>{if(x==="__proto__"||x==="constructor"||x==="prototype")throw new Error(`Detected property ${x}. This is a prototype pollution risk, please remove it from your object.`);const P=nt(w,t,r,n,[...i,x],[...s,e],u);m[x]=P.transformedValue,N(P.annotations)?p[x]=P.annotations:X(P.annotations)&&M(P.annotations,(W,A)=>{p[Ye(x)+"."+A]=W})});const h=ge(p)?{transformedValue:m,annotations:a?[a.type]:void 0}:{transformedValue:m,annotations:a?[a.type,p]:p};return l||u.set(e,h),h};function ot(e){return Object.prototype.toString.call(e).slice(8,-1)}function it(e){return ot(e)==="Array"}function nn(e){if(ot(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function on(e,t,r,n,i){const s={}.propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";s==="enumerable"&&(e[t]=r),i&&s==="nonenumerable"&&Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}function Ee(e,t={}){if(it(e))return e.map(i=>Ee(i,t));if(!nn(e))return e;const r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols(e);return[...r,...n].reduce((i,s)=>{if(it(t.props)&&!t.props.includes(s))return i;const u=e[s],l=Ee(u,t);return on(i,s,l,e,t.nonenumerable),i},{})}class b{constructor({dedupe:t=!1}={}){this.classRegistry=new Cr,this.symbolRegistry=new Me(r=>r.description??""),this.customTransformerRegistry=new Fr,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const r=new Map,n=nt(t,r,this,this.dedupe),i={json:n.transformedValue};n.annotations&&(i.meta={...i.meta,values:n.annotations});const s=rn(r,this.dedupe);return s&&(i.meta={...i.meta,referentialEqualities:s}),i}deserialize(t){const{json:r,meta:n}=t;let i=Ee(r);return n!=null&&n.values&&(i=Zr(i,n.values,this)),n!=null&&n.referentialEqualities&&(i=Qr(i,n.referentialEqualities)),i}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t))}registerClass(t,r){this.classRegistry.register(t,r)}registerSymbol(t,r){this.symbolRegistry.register(t,r)}registerCustom(t,r){this.customTransformerRegistry.register({name:r,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}}b.defaultInstance=new b,b.serialize=b.defaultInstance.serialize.bind(b.defaultInstance),b.deserialize=b.defaultInstance.deserialize.bind(b.defaultInstance),b.stringify=b.defaultInstance.stringify.bind(b.defaultInstance),b.parse=b.defaultInstance.parse.bind(b.defaultInstance),b.registerClass=b.defaultInstance.registerClass.bind(b.defaultInstance),b.registerSymbol=b.defaultInstance.registerSymbol.bind(b.defaultInstance),b.registerCustom=b.defaultInstance.registerCustom.bind(b.defaultInstance),b.allowErrorProps=b.defaultInstance.allowErrorProps.bind(b.defaultInstance),b.serialize,b.deserialize,b.stringify,b.parse,b.registerClass,b.registerCustom,b.registerSymbol,b.allowErrorProps;const sn="dev-jwt-token-for-testing",an=async()=>sn,st=j.createContext(null);function un(e,t){const r=ar({links:[Tr({enabled:n=>process.env.NODE_ENV==="development"&&typeof window<"u"||n.direction==="down"&&n.result instanceof Error}),vr({url:`${e}/trpc`,headers:async()=>({Authorization:`Bearer ${await t()}`}),transformer:b})]});return{getProjectsForUser:async()=>(await r.projectRouter.getAllProjects.query()).map(i=>({name:i.name,id:i.id})),addProjectForUser:async n=>{const i=await r.projectRouter.createProject.mutate({name:n});return{name:i.name,id:i.id}},addFilesToProject:async(n,i)=>{const s=[];for(const u of i){const l=await r.fileRouter.createFile.mutate({file:{projectId:n,mimeType:de.PDF,path:u.path,name:u.name,size:0,metadata:null,isArtifact:!1,summary:null}});s.push({path:l.path,name:l.name,id:l.id})}return s},getFilesForProject:async n=>(await r.fileRouter.getFilesByProject.query({projectId:n})).map(s=>({path:s.path,name:s.name,id:s.id}))}}function cn({children:e,host:t="http://localhost",port:r=5174,getToken:n=an}){const[i,s]=j.useState(null);return j.useEffect(()=>{const u=`${t}:${r}`,l=un(u,n);s(l)},[t,r,n]),fe.jsx(st.Provider,{value:{host:t,port:r,client:i},children:e})}function at(){const e=j.useContext(st);if(!e)throw new Error("useFolioContext must be used within a FolioProvider");return e}const{useEffect:ln,useRef:fn,useState:dn}=$t;function mn({width:e="100%",height:t="100vh",allow:r="camera; microphone; clipboard-read; clipboard-write; fullscreen",style:n,className:i="",iframeProps:s={}}){const{host:u,port:l}=at(),a=fn(null),[f,m]=dn();return ln(()=>{m(`${u}:${l}`)},[u,l]),f?fe.jsx("div",{className:`folio-embed-container ${i}`,style:{width:e,height:t,overflow:"hidden",...n},children:fe.jsx("iframe",{ref:a,src:f,width:"100%",height:"100%",style:{border:"none",width:"100%",height:"100%",overflow:"auto"},allow:r,allowFullScreen:!0,...s})}):null}function pn(){const{client:e}=at(),[t,r]=j.useState(!1),[n,i]=j.useState(null);return{isLoading:t,error:n,getProjectsForUser:async()=>{for(;!e;)await new Promise(f=>setTimeout(f,100));r(!0),i(null);try{return await e.getProjectsForUser()}catch(f){return i(f instanceof Error?f:new Error(String(f))),[]}finally{r(!1)}},addProjectForUser:async f=>{for(;!e;)await new Promise(m=>setTimeout(m,100));r(!0),i(null);try{return await e.addProjectForUser(f)}catch(m){return i(m instanceof Error?m:new Error(String(m))),null}finally{r(!1)}},addFilesToProject:async(f,m)=>{for(;!e;)await new Promise(p=>setTimeout(p,100));r(!0),i(null);try{return await e.addFilesToProject(f,m)}catch(p){return i(p instanceof Error?p:new Error(String(p))),null}finally{r(!1)}},getFilesForProject:async f=>{for(;!e;)await new Promise(m=>setTimeout(m,100));r(!0),i(null);try{return await e.getFilesForProject(f)}catch(m){return i(m instanceof Error?m:new Error(String(m))),[]}finally{r(!1)}}}}F.FolioEmbed=mn,F.FolioProvider=cn,F.useFolio=pn,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="2422" height="483" viewBox="0 0 2422 483" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M2421.1 242.256C2421.1 292.376 2411.36 334.655 2391.87 369.095C2372.38 403.387 2346.07 429.4 2312.95 447.132C2279.83 464.718 2242.9 473.511 2202.16 473.511C2161.13 473.511 2124.05 464.645 2090.93 446.913C2057.95 429.033 2031.72 402.948 2012.23 368.655C1992.89 334.216 1983.21 292.083 1983.21 242.256C1983.21 192.136 1992.89 149.929 2012.23 115.637C2031.72 81.1974 2057.95 55.1848 2090.93 37.5988C2124.05 19.8663 2161.13 11 2202.16 11C2242.9 11 2279.83 19.8663 2312.95 37.5988C2346.07 55.1848 2372.38 81.1974 2391.87 115.637C2411.36 149.929 2421.1 192.136 2421.1 242.256ZM2295.37 242.256C2295.37 215.29 2291.77 192.575 2284.59 174.11C2277.56 155.498 2267.08 141.429 2253.16 131.904C2239.38 122.231 2222.38 117.395 2202.16 117.395C2181.94 117.395 2164.86 122.231 2150.94 131.904C2137.16 141.429 2126.69 155.498 2119.51 174.11C2112.47 192.575 2108.95 215.29 2108.95 242.256C2108.95 269.221 2112.47 292.009 2119.51 310.621C2126.69 329.086 2137.16 343.155 2150.94 352.828C2164.86 362.353 2181.94 367.116 2202.16 367.116C2222.38 367.116 2239.38 362.353 2253.16 352.828C2267.08 343.155 2277.56 329.086 2284.59 310.621C2291.77 292.009 2295.37 269.221 2295.37 242.256Z" fill="#3F3F46"/>
|
|
3
|
+
<path d="M1935.05 17.155V467.356H1812.83V17.155H1935.05Z" fill="#3F3F46"/>
|
|
4
|
+
<path d="M1459.18 467.356V17.155H1581.41V368.875H1763.42V467.356H1459.18Z" fill="#3F3F46"/>
|
|
5
|
+
<path d="M1402.63 242.256C1402.63 292.376 1392.89 334.655 1373.4 369.095C1353.91 403.387 1327.6 429.4 1294.48 447.132C1261.36 464.718 1224.43 473.511 1183.69 473.511C1142.65 473.511 1105.58 464.645 1072.46 446.913C1039.48 429.033 1013.25 402.948 993.76 368.655C974.415 334.216 964.743 292.083 964.743 242.256C964.743 192.136 974.415 149.929 993.76 115.637C1013.25 81.1974 1039.48 55.1848 1072.46 37.5988C1105.58 19.8663 1142.65 11 1183.69 11C1224.43 11 1261.36 19.8663 1294.48 37.5988C1327.6 55.1848 1353.91 81.1974 1373.4 115.637C1392.89 149.929 1402.63 192.136 1402.63 242.256ZM1276.89 242.256C1276.89 215.29 1273.3 192.575 1266.12 174.11C1259.09 155.498 1248.61 141.429 1234.69 131.904C1220.91 122.231 1203.91 117.395 1183.69 117.395C1163.46 117.395 1146.39 122.231 1132.47 131.904C1118.69 141.429 1108.22 155.498 1101.03 174.11C1094 192.575 1090.48 215.29 1090.48 242.256C1090.48 269.221 1094 292.009 1101.03 310.621C1108.22 329.086 1118.69 343.155 1132.47 352.828C1146.39 362.353 1163.46 367.116 1183.69 367.116C1203.91 367.116 1220.91 362.353 1234.69 352.828C1248.61 343.155 1259.09 329.086 1266.12 310.621C1273.3 292.009 1276.89 269.221 1276.89 242.256Z" fill="#3F3F46"/>
|
|
6
|
+
<path d="M605 467.356V17.155H921.548V115.637H727.223V193.015H902.203V291.496H727.223V467.356H605Z" fill="#3F3F46"/>
|
|
7
|
+
<path d="M0 88.6035L88.831 0L329.509 241.296L240.678 329.899L0 88.6035Z" fill="#1D4ED8"/>
|
|
8
|
+
<path d="M239.677 152.027L329.136 239.996L90.1832 483L0.723308 395.031L239.677 152.027Z" fill="#1D4ED8"/>
|
|
9
|
+
<path d="M246 88.6035L334.831 7.62939e-06L575.509 241.296L486.678 329.899L246 88.6035Z" fill="#1D4ED8"/>
|
|
10
|
+
<path d="M485.676 152.027L575.136 239.996L336.183 483L246.723 395.031L485.676 152.027Z" fill="#1D4ED8"/>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="2422" height="483" viewBox="0 0 2422 483" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M2421.1 242.256C2421.1 292.376 2411.36 334.655 2391.87 369.095C2372.38 403.387 2346.07 429.4 2312.95 447.132C2279.83 464.718 2242.9 473.511 2202.16 473.511C2161.13 473.511 2124.05 464.645 2090.93 446.913C2057.95 429.033 2031.72 402.948 2012.23 368.655C1992.89 334.216 1983.21 292.083 1983.21 242.256C1983.21 192.136 1992.89 149.929 2012.23 115.637C2031.72 81.1974 2057.95 55.1848 2090.93 37.5988C2124.05 19.8663 2161.13 11 2202.16 11C2242.9 11 2279.83 19.8663 2312.95 37.5988C2346.07 55.1848 2372.38 81.1974 2391.87 115.637C2411.36 149.929 2421.1 192.136 2421.1 242.256ZM2295.37 242.256C2295.37 215.29 2291.77 192.575 2284.59 174.11C2277.56 155.498 2267.08 141.429 2253.16 131.904C2239.38 122.231 2222.38 117.395 2202.16 117.395C2181.94 117.395 2164.86 122.231 2150.94 131.904C2137.16 141.429 2126.69 155.498 2119.51 174.11C2112.47 192.575 2108.95 215.29 2108.95 242.256C2108.95 269.221 2112.47 292.009 2119.51 310.621C2126.69 329.086 2137.16 343.155 2150.94 352.828C2164.86 362.353 2181.94 367.116 2202.16 367.116C2222.38 367.116 2239.38 362.353 2253.16 352.828C2267.08 343.155 2277.56 329.086 2284.59 310.621C2291.77 292.009 2295.37 269.221 2295.37 242.256Z" fill="white"/>
|
|
3
|
+
<path d="M1935.05 17.155V467.356H1812.83V17.155H1935.05Z" fill="white"/>
|
|
4
|
+
<path d="M1459.18 467.356V17.155H1581.41V368.875H1763.42V467.356H1459.18Z" fill="white"/>
|
|
5
|
+
<path d="M1402.63 242.256C1402.63 292.376 1392.89 334.655 1373.4 369.095C1353.91 403.387 1327.6 429.4 1294.48 447.132C1261.36 464.718 1224.43 473.511 1183.69 473.511C1142.65 473.511 1105.58 464.645 1072.46 446.913C1039.48 429.033 1013.25 402.948 993.76 368.655C974.415 334.216 964.743 292.083 964.743 242.256C964.743 192.136 974.415 149.929 993.76 115.637C1013.25 81.1974 1039.48 55.1848 1072.46 37.5988C1105.58 19.8663 1142.65 11 1183.69 11C1224.43 11 1261.36 19.8663 1294.48 37.5988C1327.6 55.1848 1353.91 81.1974 1373.4 115.637C1392.89 149.929 1402.63 192.136 1402.63 242.256ZM1276.89 242.256C1276.89 215.29 1273.3 192.575 1266.12 174.11C1259.09 155.498 1248.61 141.429 1234.69 131.904C1220.91 122.231 1203.91 117.395 1183.69 117.395C1163.46 117.395 1146.39 122.231 1132.47 131.904C1118.69 141.429 1108.22 155.498 1101.03 174.11C1094 192.575 1090.48 215.29 1090.48 242.256C1090.48 269.221 1094 292.009 1101.03 310.621C1108.22 329.086 1118.69 343.155 1132.47 352.828C1146.39 362.353 1163.46 367.116 1183.69 367.116C1203.91 367.116 1220.91 362.353 1234.69 352.828C1248.61 343.155 1259.09 329.086 1266.12 310.621C1273.3 292.009 1276.89 269.221 1276.89 242.256Z" fill="white"/>
|
|
6
|
+
<path d="M605 467.356V17.155H921.548V115.637H727.223V193.015H902.203V291.496H727.223V467.356H605Z" fill="white"/>
|
|
7
|
+
<path d="M0 88.6035L88.831 0L329.509 241.296L240.678 329.899L0 88.6035Z" fill="#1D4ED8"/>
|
|
8
|
+
<path d="M239.677 152.027L329.136 239.996L90.1832 483L0.723308 395.031L239.677 152.027Z" fill="#1D4ED8"/>
|
|
9
|
+
<path d="M246 88.6035L334.831 7.62939e-06L575.509 241.296L486.678 329.899L246 88.6035Z" fill="#1D4ED8"/>
|
|
10
|
+
<path d="M485.676 152.027L575.136 239.996L336.183 483L246.723 395.031L485.676 152.027Z" fill="#1D4ED8"/>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="577" height="483" viewBox="0 0 577 483" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0 88.6035L88.831 0L329.509 241.296L240.678 329.899L0 88.6035Z" fill="#BB1695"/>
|
|
3
|
+
<path d="M239.677 152.027L329.136 239.996L90.1832 483L0.723308 395.031L239.677 152.027Z" fill="#BB1695"/>
|
|
4
|
+
<path d="M247 88.6035L335.831 0L576.509 241.296L487.678 329.899L247 88.6035Z" fill="#BB1695"/>
|
|
5
|
+
<path d="M486.676 152.027L576.136 239.996L337.183 483L247.723 395.031L486.676 152.027Z" fill="#BB1695"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="577" height="483" viewBox="0 0 577 483" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_7_27)">
|
|
3
|
+
<rect y="88.6035" width="125.465" height="340.807" transform="rotate(-44.9265 0 88.6035)" fill="#1D4ED8"/>
|
|
4
|
+
<rect x="239.677" y="152.027" width="125.465" height="340.807" transform="rotate(44.5184 239.677 152.027)" fill="#1D4ED8"/>
|
|
5
|
+
<rect x="247" y="88.6035" width="125.465" height="340.807" transform="rotate(-44.9265 247 88.6035)" fill="#1D4ED8"/>
|
|
6
|
+
<rect x="486.677" y="152.027" width="125.465" height="340.807" transform="rotate(44.5184 486.677 152.027)" fill="#1D4ED8"/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_7_27">
|
|
10
|
+
<rect width="576.509" height="483" fill="white"/>
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
13
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="375" height="97" viewBox="0 0 375 97" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M53.1818 31C52.9394 27.9697 51.803 25.6061 49.7727 23.9091C47.7727 22.2121 44.7273 21.3636 40.6364 21.3636C38.0303 21.3636 35.8939 21.6818 34.2273 22.3182C32.5909 22.9242 31.3788 23.7576 30.5909 24.8182C29.803 25.8788 29.3939 27.0909 29.3636 28.4545C29.303 29.5758 29.5 30.5909 29.9545 31.5C30.4394 32.3788 31.197 33.1818 32.2273 33.9091C33.2576 34.6061 34.5758 35.2424 36.1818 35.8182C37.7879 36.3939 39.697 36.9091 41.9091 37.3636L49.5455 39C54.697 40.0909 59.1061 41.5303 62.7727 43.3182C66.4394 45.1061 69.4394 47.2121 71.7727 49.6364C74.1061 52.0303 75.8182 54.7273 76.9091 57.7273C78.0303 60.7273 78.6061 64 78.6364 67.5455C78.6061 73.6667 77.0758 78.8485 74.0455 83.0909C71.0152 87.3333 66.6818 90.5606 61.0455 92.7727C55.4394 94.9848 48.697 96.0909 40.8182 96.0909C32.7273 96.0909 25.6667 94.8939 19.6364 92.5C13.6364 90.1061 8.9697 86.4242 5.63636 81.4545C2.33333 76.4545 0.666667 70.0606 0.636364 62.2727H24.6364C24.7879 65.1212 25.5 67.5152 26.7727 69.4545C28.0455 71.3939 29.8333 72.8636 32.1364 73.8636C34.4697 74.8636 37.2424 75.3636 40.4545 75.3636C43.1515 75.3636 45.4091 75.0303 47.2273 74.3636C49.0455 73.697 50.4242 72.7727 51.3636 71.5909C52.303 70.4091 52.7879 69.0606 52.8182 67.5455C52.7879 66.1212 52.3182 64.8788 51.4091 63.8182C50.5303 62.7273 49.0758 61.7576 47.0455 60.9091C45.0152 60.0303 42.2727 59.2121 38.8182 58.4545L29.5455 56.4545C21.303 54.6667 14.803 51.6818 10.0455 47.5C5.31818 43.2879 2.9697 37.5455 3 30.2727C2.9697 24.3636 4.54545 19.197 7.72727 14.7727C10.9394 10.3182 15.3788 6.84848 21.0455 4.36363C26.7424 1.87878 33.2727 0.63636 40.6364 0.63636C48.1515 0.63636 54.6515 1.89394 60.1364 4.40909C65.6212 6.92424 69.8485 10.4697 72.8182 15.0455C75.8182 19.5909 77.3333 24.9091 77.3636 31H53.1818ZM88.25 95V1.90909H113.523V38.2727H146.977V1.90909H172.25V95H146.977V58.6364H113.523V95H88.25ZM209.523 1.90909V95H184.25V1.90909H209.523ZM221.5 95V1.90909H286.955V22.2727H246.773V38.2727H282.955V58.6364H246.773V95H221.5ZM293.705 22.2727V1.90909H374.614V22.2727H346.614V95H321.705V22.2727H293.705Z" fill="#151414"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="375" height="97" viewBox="0 0 375 97" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M53.1818 31C52.9394 27.9697 51.803 25.6061 49.7727 23.9091C47.7727 22.2121 44.7273 21.3636 40.6364 21.3636C38.0303 21.3636 35.8939 21.6818 34.2273 22.3182C32.5909 22.9242 31.3788 23.7576 30.5909 24.8182C29.803 25.8788 29.3939 27.0909 29.3636 28.4545C29.303 29.5758 29.5 30.5909 29.9545 31.5C30.4394 32.3788 31.197 33.1818 32.2273 33.9091C33.2576 34.6061 34.5758 35.2424 36.1818 35.8182C37.7879 36.3939 39.697 36.9091 41.9091 37.3636L49.5455 39C54.697 40.0909 59.1061 41.5303 62.7727 43.3182C66.4394 45.1061 69.4394 47.2121 71.7727 49.6364C74.1061 52.0303 75.8182 54.7273 76.9091 57.7273C78.0303 60.7273 78.6061 64 78.6364 67.5455C78.6061 73.6667 77.0758 78.8485 74.0455 83.0909C71.0152 87.3333 66.6818 90.5606 61.0455 92.7727C55.4394 94.9848 48.697 96.0909 40.8182 96.0909C32.7273 96.0909 25.6667 94.8939 19.6364 92.5C13.6364 90.1061 8.9697 86.4242 5.63636 81.4545C2.33333 76.4545 0.666667 70.0606 0.636364 62.2727H24.6364C24.7879 65.1212 25.5 67.5152 26.7727 69.4545C28.0455 71.3939 29.8333 72.8636 32.1364 73.8636C34.4697 74.8636 37.2424 75.3636 40.4545 75.3636C43.1515 75.3636 45.4091 75.0303 47.2273 74.3636C49.0455 73.697 50.4242 72.7727 51.3636 71.5909C52.303 70.4091 52.7879 69.0606 52.8182 67.5455C52.7879 66.1212 52.3182 64.8788 51.4091 63.8182C50.5303 62.7273 49.0758 61.7576 47.0455 60.9091C45.0152 60.0303 42.2727 59.2121 38.8182 58.4545L29.5455 56.4545C21.303 54.6667 14.803 51.6818 10.0455 47.5C5.31818 43.2879 2.9697 37.5455 3 30.2727C2.9697 24.3636 4.54545 19.197 7.72727 14.7727C10.9394 10.3182 15.3788 6.84848 21.0455 4.36363C26.7424 1.87878 33.2727 0.63636 40.6364 0.63636C48.1515 0.63636 54.6515 1.89394 60.1364 4.40909C65.6212 6.92424 69.8485 10.4697 72.8182 15.0455C75.8182 19.5909 77.3333 24.9091 77.3636 31H53.1818ZM88.25 95V1.90909H113.523V38.2727H146.977V1.90909H172.25V95H146.977V58.6364H113.523V95H88.25ZM209.523 1.90909V95H184.25V1.90909H209.523ZM221.5 95V1.90909H286.955V22.2727H246.773V38.2727H282.955V58.6364H246.773V95H221.5ZM293.705 22.2727V1.90909H374.614V22.2727H346.614V95H321.705V22.2727H293.705Z" fill="white"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Folio",
|
|
3
|
+
"short_name": "Folio",
|
|
4
|
+
"icons": [
|
|
5
|
+
{
|
|
6
|
+
"src": "/web-app-manifest-192x192.png",
|
|
7
|
+
"sizes": "192x192",
|
|
8
|
+
"type": "image/png",
|
|
9
|
+
"purpose": "maskable"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"src": "/web-app-manifest-512x512.png",
|
|
13
|
+
"sizes": "512x512",
|
|
14
|
+
"type": "image/png",
|
|
15
|
+
"purpose": "maskable"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"orientation": "portrait",
|
|
19
|
+
"theme_color": "#18181B",
|
|
20
|
+
"display": "standalone"
|
|
21
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare const BACKDOOR_TOKEN = "dev-jwt-token-for-testing";
|
|
4
|
+
export declare const getDefaultToken: () => Promise<string>;
|
|
5
|
+
export type FolioProject = {
|
|
6
|
+
name: string;
|
|
7
|
+
id: number;
|
|
8
|
+
};
|
|
9
|
+
export type FolioFile = {
|
|
10
|
+
path: string;
|
|
11
|
+
name: string;
|
|
12
|
+
id: number;
|
|
13
|
+
};
|
|
14
|
+
export interface FolioClient {
|
|
15
|
+
getProjectsForUser: () => Promise<FolioProject[]>;
|
|
16
|
+
addProjectForUser: (projectName: string) => Promise<FolioProject>;
|
|
17
|
+
addFilesToProject: (projectId: number, files: Omit<FolioFile, "id">[]) => Promise<FolioFile[]>;
|
|
18
|
+
getFilesForProject: (projectId: number) => Promise<FolioFile[]>;
|
|
19
|
+
}
|
|
20
|
+
interface FolioContextType {
|
|
21
|
+
host: string;
|
|
22
|
+
port: number;
|
|
23
|
+
client: FolioClient | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Props for the FolioProvider component
|
|
27
|
+
*/
|
|
28
|
+
export interface FolioProviderProps {
|
|
29
|
+
/**
|
|
30
|
+
* Children components that will have access to the Folio context
|
|
31
|
+
*/
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Host for the Folio API and iframe. Default is "http://localhost"
|
|
35
|
+
*/
|
|
36
|
+
host?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Port for the Folio API and iframe. Default is 5174
|
|
39
|
+
*/
|
|
40
|
+
port?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Function to get the authentication token for API requests
|
|
43
|
+
* If not provided, the default backdoor token will be used
|
|
44
|
+
*/
|
|
45
|
+
getToken?: () => Promise<string | null>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Provider component that manages Folio application connection settings
|
|
49
|
+
* Wrap your application with this provider to enable the FolioEmbed component and useFolio hook
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* <FolioProvider host="http://my-folio-server.com" port={443} getToken={fetchAuthToken}>
|
|
53
|
+
* <App />
|
|
54
|
+
* </FolioProvider>
|
|
55
|
+
*/
|
|
56
|
+
export declare function FolioProvider({ children, host, port, getToken, }: FolioProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
/**
|
|
58
|
+
* Hook to access the Folio context
|
|
59
|
+
* Must be used within a FolioProvider component
|
|
60
|
+
*/
|
|
61
|
+
export declare function useFolioContext(): FolioContextType;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface FolioEmbedProps {
|
|
3
|
+
/**
|
|
4
|
+
* Width of the iframe. Default is "100%"
|
|
5
|
+
*/
|
|
6
|
+
width?: string | number;
|
|
7
|
+
/**
|
|
8
|
+
* Height of the iframe. Default is "100vh"
|
|
9
|
+
*/
|
|
10
|
+
height?: string | number;
|
|
11
|
+
/**
|
|
12
|
+
* Allow attributes for the iframe. Default includes all necessary permissions.
|
|
13
|
+
*/
|
|
14
|
+
allow?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Additional styles for the iframe container
|
|
17
|
+
*/
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
/**
|
|
20
|
+
* Additional class names for the iframe container
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Additional props to pass to the iframe
|
|
25
|
+
*/
|
|
26
|
+
iframeProps?: React.IframeHTMLAttributes<HTMLIFrameElement>;
|
|
27
|
+
}
|
|
28
|
+
export declare function FolioEmbed({ width, height, allow, style, className, iframeProps, }: FolioEmbedProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FolioFile, FolioProject } from './FolioContext';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook for interacting with the Folio application
|
|
5
|
+
* Provides methods to manage projects and files within Folio
|
|
6
|
+
*
|
|
7
|
+
* Must be used within a FolioProvider component
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* function MyComponent() {
|
|
11
|
+
* const { getProjectsForUser, addProjectForUser } = useFolio();
|
|
12
|
+
*
|
|
13
|
+
* const handleCreateProject = async () => {
|
|
14
|
+
* await addProjectForUser("New Project");
|
|
15
|
+
* };
|
|
16
|
+
*
|
|
17
|
+
* return (
|
|
18
|
+
* <button onClick={handleCreateProject}>Create Project</button>
|
|
19
|
+
* );
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
export declare function useFolio(): {
|
|
23
|
+
isLoading: boolean;
|
|
24
|
+
error: Error | null;
|
|
25
|
+
getProjectsForUser: () => Promise<FolioProject[]>;
|
|
26
|
+
addProjectForUser: (projectName: string) => Promise<FolioProject | null>;
|
|
27
|
+
addFilesToProject: (projectId: number, files: Array<{
|
|
28
|
+
path: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>) => Promise<FolioFile[] | null>;
|
|
31
|
+
getFilesForProject: (projectId: number) => Promise<FolioFile[]>;
|
|
32
|
+
};
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shiftengineering/folio",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.76",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/ShiftEngineering/folio.git"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist-embed-component"
|
|
12
|
+
],
|
|
13
|
+
"main": "./dist-embed-component/folio-embed.js",
|
|
14
|
+
"module": "./dist-embed-component/folio-embed.js",
|
|
15
|
+
"types": "./dist-embed-component/types/embed-component/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist-embed-component/types/embed-component/index.d.ts",
|
|
19
|
+
"import": "./dist-embed-component/folio-embed.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "pnpm dev:client & pnpm dev:api",
|
|
24
|
+
"dev:client": "pnpm generate-pwa-assets && vite --host",
|
|
25
|
+
"dev:api": "tsx --env-file .env.local --watch src/api/main.ts",
|
|
26
|
+
"dev:combined": "concurrently -k -n \"CLIENT,API\" \"pnpm generate-pwa-assets && vite build --watch\" \"SERVE_STATIC=true tsx --env-file .env.docker --watch src/api/main.ts\"",
|
|
27
|
+
"build": "pnpm build:client && pnpm build:server",
|
|
28
|
+
"build:client": "pnpm generate-pwa-assets && tsc -b && vite build",
|
|
29
|
+
"build:server": "esbuild --format=cjs --platform=node --bundle --outfile=dist/server/main.cjs --sourcemap --target=node20 src/api/main.ts",
|
|
30
|
+
"build:combined": "pnpm build:client && esbuild --format=cjs --platform=node --bundle --outfile=dist/server/combined-main.cjs --sourcemap --target=node20 --define:process.env.SERVE_STATIC=\\\"true\\\" src/api/main.ts",
|
|
31
|
+
"build:embed-component": "vite build --config vite.embed-component.config.ts",
|
|
32
|
+
"lint": "eslint .",
|
|
33
|
+
"lint:fix": "eslint . --fix",
|
|
34
|
+
"format": "prettier --write .",
|
|
35
|
+
"preview:client": "vite preview --config vite.config.ts",
|
|
36
|
+
"preview:server": "node --env-file .env.local dist/server/main.cjs",
|
|
37
|
+
"preview:combined": "SERVE_STATIC=true node --env-file .env.local dist/server/combined-main.cjs",
|
|
38
|
+
"preview": "pnpm preview:client & pnpm preview:server",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "vitest watch",
|
|
41
|
+
"coverage": "vitest run --coverage",
|
|
42
|
+
"prepare": "husky",
|
|
43
|
+
"generate-pwa-assets": "pwa-assets-generator"
|
|
44
|
+
},
|
|
45
|
+
"lint-staged": {
|
|
46
|
+
"*.{js,jsx,ts,tsx,json,jsonc,md,css,scss,html}": [
|
|
47
|
+
"eslint --fix",
|
|
48
|
+
"prettier --write"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@ai-sdk/anthropic": "^1.1.6",
|
|
53
|
+
"@ai-sdk/openai": "^1.1.9",
|
|
54
|
+
"@clerk/clerk-react": "^5.22.11",
|
|
55
|
+
"@clerk/fastify": "^2.1.19",
|
|
56
|
+
"@clerk/types": "^4.45.0",
|
|
57
|
+
"@eslint/js": "^9.19.0",
|
|
58
|
+
"@fastify/cors": "^10.0.2",
|
|
59
|
+
"@fastify/static": "^8.1.1",
|
|
60
|
+
"@hookform/resolvers": "^3.10.0",
|
|
61
|
+
"@iconify/react": "^5.2.0",
|
|
62
|
+
"@radix-ui/react-accordion": "^1.2.3",
|
|
63
|
+
"@radix-ui/react-alert-dialog": "^1.1.6",
|
|
64
|
+
"@radix-ui/react-aspect-ratio": "^1.1.2",
|
|
65
|
+
"@radix-ui/react-avatar": "^1.1.3",
|
|
66
|
+
"@radix-ui/react-checkbox": "^1.1.4",
|
|
67
|
+
"@radix-ui/react-collapsible": "^1.1.3",
|
|
68
|
+
"@radix-ui/react-context-menu": "^2.2.6",
|
|
69
|
+
"@radix-ui/react-dialog": "^1.1.6",
|
|
70
|
+
"@radix-ui/react-dropdown-menu": "^2.1.6",
|
|
71
|
+
"@radix-ui/react-hover-card": "^1.1.6",
|
|
72
|
+
"@radix-ui/react-label": "^2.1.2",
|
|
73
|
+
"@radix-ui/react-menubar": "^1.1.6",
|
|
74
|
+
"@radix-ui/react-navigation-menu": "^1.2.5",
|
|
75
|
+
"@radix-ui/react-popover": "^1.1.6",
|
|
76
|
+
"@radix-ui/react-progress": "^1.1.2",
|
|
77
|
+
"@radix-ui/react-radio-group": "^1.2.3",
|
|
78
|
+
"@radix-ui/react-scroll-area": "^1.2.3",
|
|
79
|
+
"@radix-ui/react-select": "^2.1.6",
|
|
80
|
+
"@radix-ui/react-separator": "^1.1.2",
|
|
81
|
+
"@radix-ui/react-slider": "^1.2.3",
|
|
82
|
+
"@radix-ui/react-slot": "^1.1.2",
|
|
83
|
+
"@radix-ui/react-switch": "^1.1.3",
|
|
84
|
+
"@radix-ui/react-tabs": "^1.1.3",
|
|
85
|
+
"@radix-ui/react-toast": "^1.2.6",
|
|
86
|
+
"@radix-ui/react-toggle": "^1.1.2",
|
|
87
|
+
"@radix-ui/react-toggle-group": "^1.1.2",
|
|
88
|
+
"@radix-ui/react-tooltip": "^1.1.8",
|
|
89
|
+
"@radix-ui/react-visually-hidden": "^1.1.2",
|
|
90
|
+
"@tanstack/react-query": "^5.66.7",
|
|
91
|
+
"@tanstack/react-query-devtools": "^5.66.5",
|
|
92
|
+
"@tanstack/react-router": "^1.114.24",
|
|
93
|
+
"@tanstack/react-table": "^8.20.6",
|
|
94
|
+
"@tanstack/router-devtools": "^1.99.8",
|
|
95
|
+
"@tanstack/router-plugin": "^1.99.8",
|
|
96
|
+
"@testing-library/dom": "^10.4.0",
|
|
97
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
98
|
+
"@testing-library/react": "^16.2.0",
|
|
99
|
+
"@testing-library/user-event": "^14.6.1",
|
|
100
|
+
"@trpc/client": "11.0.0-rc.795",
|
|
101
|
+
"@trpc/react-query": "11.0.0-rc.608",
|
|
102
|
+
"@trpc/server": "11.0.0-rc.795",
|
|
103
|
+
"@trpc/tanstack-react-query": "11.0.0-rc.795",
|
|
104
|
+
"@types/lodash.debounce": "^4.0.9",
|
|
105
|
+
"@types/mime-types": "^2.1.4",
|
|
106
|
+
"@types/node": "^22.13.1",
|
|
107
|
+
"@types/react": "^18.3.18",
|
|
108
|
+
"@types/react-dom": "^18.3.5",
|
|
109
|
+
"@types/pg": "^8.11.11",
|
|
110
|
+
"@vite-pwa/assets-generator": "^0.2.6",
|
|
111
|
+
"@vitejs/plugin-basic-ssl": "^1.2.0",
|
|
112
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
113
|
+
"@vitejs/plugin-react-swc": "^3.7.2",
|
|
114
|
+
"@vitest/coverage-v8": "2.1.5",
|
|
115
|
+
"ai": "^4.1.24",
|
|
116
|
+
"autoprefixer": "^10.4.20",
|
|
117
|
+
"cdktf-cli": "^0.20.11",
|
|
118
|
+
"class-variance-authority": "^0.7.1",
|
|
119
|
+
"clsx": "^2.1.1",
|
|
120
|
+
"cmdk": "1.0.0",
|
|
121
|
+
"concurrently": "^9.1.2",
|
|
122
|
+
"embla-carousel-react": "^8.5.2",
|
|
123
|
+
"esbuild": "^0.24.2",
|
|
124
|
+
"eslint": "^9.19.0",
|
|
125
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
126
|
+
"eslint-plugin-react-refresh": "^0.4.18",
|
|
127
|
+
"fastify": "^5.2.1",
|
|
128
|
+
"framer-motion": "^11.18.2",
|
|
129
|
+
"globals": "^15.14.0",
|
|
130
|
+
"happy-dom": "^17.1.1",
|
|
131
|
+
"hast-util-to-jsx-runtime": "^2.3.2",
|
|
132
|
+
"husky": "^9.1.7",
|
|
133
|
+
"input-otp": "^1.4.2",
|
|
134
|
+
"jsdom": "^25.0.1",
|
|
135
|
+
"kysely": "^0.27.5",
|
|
136
|
+
"lint-staged": "^15.4.3",
|
|
137
|
+
"lodash.debounce": "^4.0.8",
|
|
138
|
+
"lucide-react": "^0.454.0",
|
|
139
|
+
"mime-types": "^2.1.35",
|
|
140
|
+
"native-file-system-adapter": "^3.0.1",
|
|
141
|
+
"next-themes": "^0.4.4",
|
|
142
|
+
"openai": "^4.83.0",
|
|
143
|
+
"pdfjs-dist": "4.4.168",
|
|
144
|
+
"pg": "^8.13.3",
|
|
145
|
+
"postcss": "^8.5.1",
|
|
146
|
+
"postcss-cli": "^11.0.1",
|
|
147
|
+
"prettier": "3.4.2",
|
|
148
|
+
"prettier-plugin-organize-imports": "^4.1.0",
|
|
149
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
150
|
+
"react": "^18.3.1",
|
|
151
|
+
"react-day-picker": "8.10.1",
|
|
152
|
+
"react-dom": "^18.3.1",
|
|
153
|
+
"react-hook-form": "^7.54.2",
|
|
154
|
+
"react-markdown": "^9.0.3",
|
|
155
|
+
"react-pdf-highlighter-extended": "^8.1.0",
|
|
156
|
+
"react-resizable-panels": "^2.1.7",
|
|
157
|
+
"react-rnd": "^10.4.14",
|
|
158
|
+
"recharts": "^2.15.1",
|
|
159
|
+
"remark-gfm": "^4.0.0",
|
|
160
|
+
"shiki": "^2.3.2",
|
|
161
|
+
"sonner": "^1.7.4",
|
|
162
|
+
"sqlocal": "^0.12.0",
|
|
163
|
+
"superjson": "^2.2.2",
|
|
164
|
+
"tailwind-merge": "^2.6.0",
|
|
165
|
+
"tailwind-scrollbar": "^3.1.0",
|
|
166
|
+
"tailwindcss": "^3.4.17",
|
|
167
|
+
"tailwindcss-animate": "^1.0.7",
|
|
168
|
+
"tsx": "^4.19.2",
|
|
169
|
+
"typescript": "~5.6.3",
|
|
170
|
+
"typescript-eslint": "^8.23.0",
|
|
171
|
+
"vaul": "^1.1.2",
|
|
172
|
+
"vite": "^5.4.14",
|
|
173
|
+
"vite-plugin-dts": "^3.9.1",
|
|
174
|
+
"vite-plugin-pwa": "^0.21.1",
|
|
175
|
+
"vitest": "^2.1.9",
|
|
176
|
+
"zod": "^3.24.1",
|
|
177
|
+
"zustand": "^5.0.3"
|
|
178
|
+
},
|
|
179
|
+
"packageManager": "pnpm@10.2.0",
|
|
180
|
+
"pnpm": {
|
|
181
|
+
"supportedArchitectures": {
|
|
182
|
+
"os": [
|
|
183
|
+
"linux",
|
|
184
|
+
"darwin"
|
|
185
|
+
],
|
|
186
|
+
"cpu": [
|
|
187
|
+
"x64",
|
|
188
|
+
"arm64"
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
"onlyBuiltDependencies": [
|
|
192
|
+
"sharp",
|
|
193
|
+
"@cdktf/node-pty-prebuilt-multiarch",
|
|
194
|
+
"@clerk/shared",
|
|
195
|
+
"@swc/core",
|
|
196
|
+
"canvas",
|
|
197
|
+
"esbuild"
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"peerDependencies": {
|
|
201
|
+
"react": "^18.3.1",
|
|
202
|
+
"react-dom": "^18.3.1"
|
|
203
|
+
}
|
|
204
|
+
}
|