quantum-component-library 1.4.48-dev.2 → 1.4.48-dev.4
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/dist/components.cjs +1 -1
- package/dist/components.js +1193 -1150
- package/dist/{dnd-core-vendor-CErAmYu_.js → dnd-core-vendor-P5FwdnRw.js} +2 -2
- package/dist/{dnd-core-vendor-2Ve0kqUN.cjs → dnd-core-vendor-qc3HexmT.cjs} +1 -1
- package/dist/{graphql-Dbkm2qZl.js → graphql-D_8ExpKx.js} +11 -11
- package/dist/graphql-vendor-Clpf4KGC.js +669 -0
- package/dist/graphql-vendor-Duv5PgOG.cjs +14 -0
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +61 -51
- package/dist/index.cjs +1 -1
- package/dist/index.js +6 -6
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/use-ui-label-context.d.ts +1 -0
- package/dist/lib/providers/ui-label-provider/context.d.ts +2 -2
- package/dist/providers.cjs +1 -1
- package/dist/providers.js +27 -33
- package/dist/{react-dnd-vendor-BPzSDojS.cjs → react-dnd-vendor-C9CZcQ3Z.cjs} +1 -1
- package/dist/{react-dnd-vendor-D4nn9Mqx.js → react-dnd-vendor-CklV8_LH.js} +2 -2
- package/dist/{react-select-vendor-BlY9Il4Q.js → react-select-vendor-CEyywmHR.js} +1 -1
- package/dist/{react-select-vendor-D_Q2fL5j.cjs → react-select-vendor-Dz7HnrhR.cjs} +1 -1
- package/dist/services.cjs +1 -1
- package/dist/services.js +73 -73
- package/dist/vendor-BruMPwbF.cjs +1 -0
- package/dist/vendor-DJTRwKAQ.js +421 -0
- package/package.json +2 -2
- package/dist/graphql-vendor-BWnD0b-j.js +0 -1285
- package/dist/graphql-vendor-CL0XsjHb.cjs +0 -19
- package/dist/vendor-BjLvygDR.cjs +0 -1
- package/dist/vendor-VALJ9W3p.js +0 -526
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";const A=require("./vendor-BruMPwbF.cjs");var Z={OPERATION_DEFINITION:"OperationDefinition"};class J extends Error{constructor(t,n,a,c,l,s,f){super(t),this.name="GraphQLError",this.message=t,l&&(this.path=l),n&&(this.nodes=Array.isArray(n)?n:[n]),a&&(this.source=a),c&&(this.positions=c),s&&(this.originalError=s);var p=f;if(!p&&s){var v=s.extensions;v&&typeof v=="object"&&(p=v)}this.extensions=p||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}}var i,r;function m(e){return new J(`Syntax Error: Unexpected token at ${r} in ${e}`)}function R(e){if(e.lastIndex=r,e.test(i))return i.slice(r,r=e.lastIndex)}var _=/ +(?=[^\s])/y;function ee(e){for(var t=e.split(`
|
|
2
|
+
`),n="",a=0,c=0,l=t.length-1,s=0;s<t.length;s++)_.lastIndex=0,_.test(t[s])&&(s&&(!a||_.lastIndex<a)&&(a=_.lastIndex),c=c||s,l=s);for(var f=c;f<=l;f++)f!==c&&(n+=`
|
|
3
|
+
`),n+=t[f].slice(a).replace(/\\"""/g,'"""');return n}function u(){for(var e=0|i.charCodeAt(r++);e===9||e===10||e===13||e===32||e===35||e===44||e===65279;e=0|i.charCodeAt(r++))if(e===35)for(;(e=0|i.charCodeAt(r++))&&e!==10&&e!==13;);r--}function M(){for(var e=r,t=0|i.charCodeAt(r++);t>=48&&t<=57||t>=65&&t<=90||t===95||t>=97&&t<=122;t=0|i.charCodeAt(r++));if(e===r-1)throw m("Name");var n=i.slice(e,--r);return u(),n}function k(){return{kind:"Name",value:M()}}var te=/(?:"""|(?:[\s\S]*?[^\\])""")/y,re=/(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;function x(e){var t;switch(i.charCodeAt(r)){case 91:r++,u();for(var n=[];i.charCodeAt(r)!==93;)n.push(x(e));return r++,u(),{kind:"ListValue",values:n};case 123:r++,u();for(var a=[];i.charCodeAt(r)!==125;){var c=k();if(i.charCodeAt(r++)!==58)throw m("ObjectField");u(),a.push({kind:"ObjectField",name:c,value:x(e)})}return r++,u(),{kind:"ObjectValue",fields:a};case 36:if(e)throw m("Variable");return r++,{kind:"Variable",name:k()};case 34:if(i.charCodeAt(r+1)===34&&i.charCodeAt(r+2)===34){if(r+=3,(t=R(te))==null)throw m("StringValue");return u(),{kind:"StringValue",value:ee(t.slice(0,-3)),block:!0}}else{var l=r,s;r++;var f=!1;for(s=0|i.charCodeAt(r++);s===92&&(r++,f=!0)||s!==10&&s!==13&&s!==34&&s;s=0|i.charCodeAt(r++));if(s!==34)throw m("StringValue");return t=i.slice(l,r),u(),{kind:"StringValue",value:f?JSON.parse(t):t.slice(1,-1),block:!1}}case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:for(var p=r++,v;(v=0|i.charCodeAt(r++))>=48&&v<=57;);var h=i.slice(p,--r);if((v=i.charCodeAt(r))===46||v===69||v===101){if((t=R(re))==null)throw m("FloatValue");return u(),{kind:"FloatValue",value:h+t}}else return u(),{kind:"IntValue",value:h};case 110:if(i.charCodeAt(r+1)===117&&i.charCodeAt(r+2)===108&&i.charCodeAt(r+3)===108)return r+=4,u(),{kind:"NullValue"};break;case 116:if(i.charCodeAt(r+1)===114&&i.charCodeAt(r+2)===117&&i.charCodeAt(r+3)===101)return r+=4,u(),{kind:"BooleanValue",value:!0};break;case 102:if(i.charCodeAt(r+1)===97&&i.charCodeAt(r+2)===108&&i.charCodeAt(r+3)===115&&i.charCodeAt(r+4)===101)return r+=5,u(),{kind:"BooleanValue",value:!1};break}return{kind:"EnumValue",value:M()}}function W(e){if(i.charCodeAt(r)===40){var t=[];r++,u();do{var n=k();if(i.charCodeAt(r++)!==58)throw m("Argument");u(),t.push({kind:"Argument",name:n,value:x(e)})}while(i.charCodeAt(r)!==41);return r++,u(),t}}function b(e){if(i.charCodeAt(r)===64){var t=[];do r++,t.push({kind:"Directive",name:k(),arguments:W(e)});while(i.charCodeAt(r)===64);return t}}function ne(){for(var e=0;i.charCodeAt(r)===91;)e++,r++,u();var t={kind:"NamedType",name:k()};do if(i.charCodeAt(r)===33&&(r++,u(),t={kind:"NonNullType",type:t}),e){if(i.charCodeAt(r++)!==93)throw m("NamedType");u(),t={kind:"ListType",type:t}}while(e--);return t}function j(){if(i.charCodeAt(r++)!==123)throw m("SelectionSet");return u(),L()}function L(){var e=[];do if(i.charCodeAt(r)===46){if(i.charCodeAt(++r)!==46||i.charCodeAt(++r)!==46)throw m("SelectionSet");switch(r++,u(),i.charCodeAt(r)){case 64:e.push({kind:"InlineFragment",typeCondition:void 0,directives:b(!1),selectionSet:j()});break;case 111:i.charCodeAt(r+1)===110?(r+=2,u(),e.push({kind:"InlineFragment",typeCondition:{kind:"NamedType",name:k()},directives:b(!1),selectionSet:j()})):e.push({kind:"FragmentSpread",name:k(),directives:b(!1)});break;case 123:r++,u(),e.push({kind:"InlineFragment",typeCondition:void 0,directives:void 0,selectionSet:L()});break;default:e.push({kind:"FragmentSpread",name:k(),directives:b(!1)})}}else{var t=k(),n=void 0;i.charCodeAt(r)===58&&(r++,u(),n=t,t=k());var a=W(!1),c=b(!1),l=void 0;i.charCodeAt(r)===123&&(r++,u(),l=L()),e.push({kind:"Field",alias:n,name:t,arguments:a,directives:c,selectionSet:l})}while(i.charCodeAt(r)!==125);return r++,u(),{kind:"SelectionSet",selections:e}}function ie(){if(u(),i.charCodeAt(r)===40){var e=[];r++,u();do{var t=void 0;if(i.charCodeAt(r)===34&&(t=x(!0)),i.charCodeAt(r++)!==36)throw m("Variable");var n=k();if(i.charCodeAt(r++)!==58)throw m("VariableDefinition");u();var a=ne(),c=void 0;i.charCodeAt(r)===61&&(r++,u(),c=x(!0)),u();var l={kind:"VariableDefinition",variable:{kind:"Variable",name:n},type:a,defaultValue:c,directives:b(!0)};t&&(l.description=t),e.push(l)}while(i.charCodeAt(r)!==41);return r++,u(),e}}function ae(e){var t=k();if(i.charCodeAt(r++)!==111||i.charCodeAt(r++)!==110)throw m("FragmentDefinition");u();var n={kind:"FragmentDefinition",name:t,typeCondition:{kind:"NamedType",name:k()},directives:b(!1),selectionSet:j()};return e&&(n.description=e),n}function B(){var e=[];do{var t=void 0;if(i.charCodeAt(r)===34&&(t=x(!0)),i.charCodeAt(r)===123){if(t)throw m("Document");r++,u(),e.push({kind:"OperationDefinition",operation:"query",name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:L()})}else{var n=M();switch(n){case"fragment":e.push(ae(t));break;case"query":case"mutation":case"subscription":var a,c=void 0;(a=i.charCodeAt(r))!==40&&a!==64&&a!==123&&(c=k());var l={kind:"OperationDefinition",operation:n,name:c,variableDefinitions:ie(),directives:b(!1),selectionSet:j()};t&&(l.description=t),e.push(l);break;default:throw m("Document")}}}while(r<i.length);return e}function oe(e,t){return i=e.body?e.body:e,r=0,u(),t&&t.noLocation?{kind:"Document",definitions:B()}:{kind:"Document",definitions:B(),loc:{start:0,end:i.length,startToken:void 0,endToken:void 0,source:{body:i,name:"graphql.web",locationOffset:{line:1,column:1}}}}}function g(e,t,n){for(var a="",c=0;c<e.length;c++)c&&(a+=t),a+=n(e[c]);return a}function se(e){return JSON.stringify(e)}function ce(e){return`"""
|
|
4
|
+
`+e.replace(/"""/g,'\\"""')+`
|
|
5
|
+
"""`}var S=`
|
|
6
|
+
`,d={OperationDefinition(e){var t="";e.description&&(t+=d.StringValue(e.description)+`
|
|
7
|
+
`),t+=e.operation,e.name&&(t+=" "+e.name.value),e.variableDefinitions&&e.variableDefinitions.length&&(e.name||(t+=" "),t+="("+g(e.variableDefinitions,", ",d.VariableDefinition)+")"),e.directives&&e.directives.length&&(t+=" "+g(e.directives," ",d.Directive));var n=d.SelectionSet(e.selectionSet);return t!=="query"?t+" "+n:n},VariableDefinition(e){var t="";return e.description&&(t+=d.StringValue(e.description)+" "),t+=d.Variable(e.variable)+": "+C(e.type),e.defaultValue&&(t+=" = "+C(e.defaultValue)),e.directives&&e.directives.length&&(t+=" "+g(e.directives," ",d.Directive)),t},Field(e){var t=e.alias?e.alias.value+": "+e.name.value:e.name.value;if(e.arguments&&e.arguments.length){var n=g(e.arguments,", ",d.Argument);t.length+n.length+2>80?t+="("+(S+=" ")+g(e.arguments,S,d.Argument)+(S=S.slice(0,-2))+")":t+="("+n+")"}return e.directives&&e.directives.length&&(t+=" "+g(e.directives," ",d.Directive)),e.selectionSet&&e.selectionSet.selections.length&&(t+=" "+d.SelectionSet(e.selectionSet)),t},StringValue(e){return e.block?ce(e.value).replace(/\n/g,S):se(e.value)},BooleanValue:e=>""+e.value,NullValue:e=>"null",IntValue:e=>e.value,FloatValue:e=>e.value,EnumValue:e=>e.value,Name:e=>e.value,Variable:e=>"$"+e.name.value,ListValue:e=>"["+g(e.values,", ",C)+"]",ObjectValue:e=>"{"+g(e.fields,", ",d.ObjectField)+"}",ObjectField:e=>e.name.value+": "+C(e.value),Document(e){return!e.definitions||!e.definitions.length?"":g(e.definitions,`
|
|
8
|
+
|
|
9
|
+
`,C)},SelectionSet:e=>"{"+(S+=" ")+g(e.selections,S,C)+(S=S.slice(0,-2))+"}",Argument:e=>e.name.value+": "+C(e.value),FragmentSpread(e){var t="..."+e.name.value;return e.directives&&e.directives.length&&(t+=" "+g(e.directives," ",d.Directive)),t},InlineFragment(e){var t="...";return e.typeCondition&&(t+=" on "+e.typeCondition.name.value),e.directives&&e.directives.length&&(t+=" "+g(e.directives," ",d.Directive)),t+=" "+d.SelectionSet(e.selectionSet)},FragmentDefinition(e){var t="";return e.description&&(t+=d.StringValue(e.description)+`
|
|
10
|
+
`),t+="fragment "+e.name.value,t+=" on "+e.typeCondition.name.value,e.directives&&e.directives.length&&(t+=" "+g(e.directives," ",d.Directive)),t+" "+d.SelectionSet(e.selectionSet)},Directive(e){var t="@"+e.name.value;return e.arguments&&e.arguments.length&&(t+="("+g(e.arguments,", ",d.Argument)+")"),t},NamedType:e=>e.name.value,ListType:e=>"["+C(e.type)+"]",NonNullType:e=>C(e.type)+"!"},C=e=>d[e.kind](e);function ue(e){return S=`
|
|
11
|
+
`,d[e.kind]?d[e.kind](e):""}var le=e=>e&&typeof e.message=="string"&&(e.extensions||e.name==="GraphQLError")?e:typeof e=="object"&&typeof e.message=="string"?new J(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):new J(e);class de extends Error{constructor(t){var n=(t.graphQLErrors||[]).map(le),a=((c,l)=>{var s="";if(c)return`[Network] ${c.message}`;if(l)for(var f=0,p=l.length;f<p;f++)s&&(s+=`
|
|
12
|
+
`),s+=`[GraphQL] ${l[f].message}`;return s})(t.networkError,n);super(a),this.name="CombinedError",this.message=a,this.graphQLErrors=n,this.networkError=t.networkError,this.response=t.response}toString(){return this.message}}var I=(e,t)=>{for(var n=0|(t||5381),a=0,c=0|e.length;a<c;a++)n=(n<<5)+n+e.charCodeAt(a);return n},F=new Set,P=new WeakMap,w=(e,t)=>{if(e===null||F.has(e))return"null";if(typeof e!="object")return JSON.stringify(e)||"";if(e.toJSON)return w(e.toJSON());if(Array.isArray(e)){for(var n="[",a=0,c=e.length;a<c;a++)n.length>1&&(n+=","),n+=w(e[a])||"null";return n+="]"}var l=Object.keys(e).sort();if(!l.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var s=P.get(e)||Math.random().toString(36).slice(2);return P.set(e,s),w({__key:s})}F.add(e);for(var f="{",p=0,v=l.length;p<v;p++){var h=w(e[l[p]]);h&&(f.length>1&&(f+=","),f+=w(l[p])+":"+h)}return F.delete(e),f+="}"},fe=(e,t)=>(F.clear(),w(e)),ve=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,he=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,pe=(e,t)=>t%2==0?e.replace(he,`
|
|
13
|
+
`):e,z=e=>e.split(ve).map(pe).join("").trim(),U=new Map,T=new Map,K=e=>{var t;return typeof e=="string"?t=z(e):e.loc&&T.get(e.__key)===e?t=e.loc.source.body:(t=U.get(e)||z(ue(e)),U.set(e,t)),typeof e!="string"&&!e.loc&&(e.loc={start:0,end:t.length,source:{body:t,name:"gql",locationOffset:{line:1,column:1}}}),t},H=e=>{var t;if(e.documentId)t=I(e.documentId);else if(t=I(K(e)),e.definitions){var n=ke(e);n&&(t=I(`
|
|
14
|
+
# ${n}`,t))}return t},me=e=>{var t,n;return typeof e=="string"?(t=H(e),n=T.get(t)||oe(e,{noLocation:!0})):(t=e.__key||H(e),n=T.get(t)||e),n.loc||K(n),n.__key=t,T.set(t,n),n},ge=(e,t,n)=>{var a=t||{},c=me(e),l=fe(a),s=c.__key;return l!=="{}"&&(s=I(l,s)),{key:s,query:c,variables:a,extensions:n}},ke=e=>{for(var t=0,n=e.definitions.length;t<n;t++){var a=e.definitions[t];if(a.kind===Z.OPERATION_DEFINITION)return a.name?a.name.value:void 0}},Ae=(e,t,n)=>({operation:e,data:void 0,error:new de({networkError:t,response:n}),extensions:void 0,hasNext:!1,stale:!1});function X(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var $=(e,t)=>X(e.kind,e,{...e.context,authAttempt:t});function ye(e){return({client:t,forward:n})=>{var a=new Set,c=A.makeSubject(),l=A.makeSubject(),s=new Map;function f(){v=void 0;var O=s;s=new Map,O.forEach(c.next)}function p(O){v=void 0;var D=s;s=new Map,D.forEach((N=>{l.next(Ae(N,O))}))}var v,h=null;return O=>{function D(){v=Promise.resolve().then((()=>e({mutate(o,E,y){var q=t.createRequestOperation("mutation",ge(o,E),y);return A.toPromise(A.take(1)(A.filter((V=>V.operation.key===q.key&&q.context._instance===V.operation.context._instance))(A.onStart((()=>{var V=Q(q);a.add(V.context._instance),c.next(V)}))(G))))},appendHeaders(o,E){var y=typeof o.context.fetchOptions=="function"?o.context.fetchOptions():o.context.fetchOptions||{};return X(o.kind,o,{...o.context,fetchOptions:{...y,headers:{...y.headers,...E}}})}}))).then((o=>{o&&(h=o),f()})).catch((o=>{process.env.NODE_ENV!=="production"&&console.warn("authExchange()’s initialization function has failed, which is unexpected.\nIf your initialization function is expected to throw/reject, catch this error and handle it explicitly.\nUnless this error is handled it’ll be passed onto any `OperationResult` instantly and authExchange() will block further operations and retry.",o),p(o)}))}D();function N(o){s.set(o.key,$(o,!0)),h&&!v&&(v=h.refreshAuth().then(f).catch(p))}function Q(o){return h?h.addAuthToOperation(o):o}var Y=A.filter(Boolean)(A.map((o=>o.kind==="teardown"?(s.delete(o.key),o):o.context._instance&&a.has(o.context._instance)?o:o.context.authAttempt?Q(o):v||!h?(v||D(),s.has(o.key)||s.set(o.key,$(o,!1)),null):(function(y){return!y.context.authAttempt&&h&&h.willAuthError&&h.willAuthError(y)})(o)?(N(o),null):Q($(o,!1))))(A.merge([c.source,O]))),G=n(Y);return A.merge([l.source,A.filter((o=>!a.has(o.operation.context._instance)&&o.error&&(function(y){return h&&h.didAuthError&&h.didAuthError(y.error,y.operation)})(o)&&!o.operation.context.authAttempt?(N(o.operation),!1):(a.has(o.operation.context._instance)&&a.delete(o.operation.context._instance),!0)))(G)])}}}exports.authExchange=ye;
|
package/dist/hooks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./graphql-vendor-Duv5PgOG.cjs"),a=require("react"),l=require("urql"),i=require("./services.cjs"),u=require("./types.cjs"),h=require("./providers.cjs");require("./react-jsx-runtime-vendor-Dszzpdy0.cjs");require("./graphql-D4Dr9NG1.cjs");const f=({url:e,getAuthToken:t})=>new l.Client({url:e,requestPolicy:"cache-and-network",exchanges:[g.authExchange(r=>{const n=t();return Promise.resolve({addAuthToOperation(s){return n?r.appendHeaders(s,{Authorization:`Bearer ${n}`}):s},didAuthError:s=>/unauthorized/gi.test(s?.message),refreshAuth:()=>Promise.resolve()})}),l.fetchExchange]}),q=({url:e,getAuthToken:t})=>a.useMemo(()=>f({url:e,getAuthToken:t}),[e,t]),c=e=>{const t=i.getAllAvailableJoints();return a.useMemo(()=>t.filter(r=>r.id==="NavalSpine"||r.id==="ChestSpine"?!1:i.limbsRequiredForJoints[r.id].every(s=>e.includes(s))),[e,t])},m=e=>{const t=a.useMemo(()=>e.map(u.sensorLocationToLimbId).filter(n=>!!n),[e]);return c(t)},d=e=>a.useMemo(()=>{const r=i.getAllAvailableLimbs(),n=e.map(u.sensorLocationToLimbId);return r.filter(s=>n.includes(s.id))},[e]),b=(e,t)=>a.useMemo(()=>e.flatMap(n=>i.getEnabledJointPlanes(n,t).map(s=>({id:{joint:n},plane:s,...i.getDefaultJointRange(n,s)}))),[e,t]),p=(e,t)=>{const r=a.useMemo(()=>{const s=i.getAllAvailableLimbs();return e.filter(o=>s.some(L=>L.id===o))},[e]);return a.useMemo(()=>r.flatMap(s=>i.getEnabledSegmentPlanes(s,t).map(o=>({id:{segment:s},plane:o,...i.getDefaultLimbRange(s,o)}))),[r,t])},F=e=>{const t=d(e),r=m(e),n=b(r.map(o=>o.id),u.AngleDataSource.Sensor),s=p(t.map(o=>o.id),u.AngleDataSource.Sensor);return[...n,...s]},P=()=>{const e=a.useContext(h.UiLabelContext);if(e===void 0)throw new Error("useUiLabelContext must be used within a UiLabelProvider");return e};exports.useGraphqlClient=q;exports.useJointsForLimbIds=c;exports.useJointsForSensorLocations=m;exports.useLimbsForSensorLocations=d;exports.usePartOptionsForJoints=b;exports.usePartOptionsForLimbs=p;exports.usePartOptionsForSensorLocations=F;exports.useUiLabelContext=P;
|
package/dist/hooks.js
CHANGED
|
@@ -1,83 +1,93 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMemo as i } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { a as c } from "./graphql-vendor-Clpf4KGC.js";
|
|
2
|
+
import { useMemo as i, useContext as d } from "react";
|
|
3
|
+
import { Client as p, fetchExchange as b } from "urql";
|
|
4
|
+
import { getAllAvailableJoints as f, limbsRequiredForJoints as g, getAllAvailableLimbs as m, getEnabledJointPlanes as h, getDefaultJointRange as L, getEnabledSegmentPlanes as x, getDefaultLimbRange as P } from "./services.js";
|
|
5
|
+
import { sensorLocationToLimbId as u, AngleDataSource as a } from "./types.js";
|
|
6
|
+
import { UiLabelContext as v } from "./providers.js";
|
|
7
|
+
import "./react-jsx-runtime-vendor-OVHDjVDe.js";
|
|
8
|
+
import "./graphql-D_8ExpKx.js";
|
|
9
|
+
const A = ({
|
|
6
10
|
url: e,
|
|
7
|
-
getAuthToken:
|
|
8
|
-
}) => new
|
|
11
|
+
getAuthToken: r
|
|
12
|
+
}) => new p({
|
|
9
13
|
url: e,
|
|
10
14
|
requestPolicy: "cache-and-network",
|
|
11
15
|
exchanges: [
|
|
12
|
-
|
|
13
|
-
const n =
|
|
16
|
+
c((s) => {
|
|
17
|
+
const n = r();
|
|
14
18
|
return Promise.resolve({
|
|
15
|
-
addAuthToOperation(
|
|
16
|
-
return n ? s.appendHeaders(
|
|
19
|
+
addAuthToOperation(t) {
|
|
20
|
+
return n ? s.appendHeaders(t, {
|
|
17
21
|
Authorization: `Bearer ${n}`
|
|
18
|
-
}) :
|
|
22
|
+
}) : t;
|
|
19
23
|
},
|
|
20
|
-
didAuthError: (
|
|
24
|
+
didAuthError: (t) => /unauthorized/gi.test(t?.message),
|
|
21
25
|
refreshAuth: () => Promise.resolve()
|
|
22
26
|
});
|
|
23
27
|
}),
|
|
24
|
-
|
|
28
|
+
b
|
|
25
29
|
]
|
|
26
|
-
}),
|
|
30
|
+
}), y = ({
|
|
27
31
|
url: e,
|
|
28
|
-
getAuthToken:
|
|
32
|
+
getAuthToken: r
|
|
29
33
|
}) => i(
|
|
30
|
-
() =>
|
|
31
|
-
[e,
|
|
32
|
-
),
|
|
33
|
-
const
|
|
34
|
-
return i(() =>
|
|
35
|
-
},
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
},
|
|
39
|
-
const s =
|
|
40
|
-
return s.filter((
|
|
41
|
-
}, [e]),
|
|
34
|
+
() => A({ url: e, getAuthToken: r }),
|
|
35
|
+
[e, r]
|
|
36
|
+
), C = (e) => {
|
|
37
|
+
const r = f();
|
|
38
|
+
return i(() => r.filter((s) => s.id === "NavalSpine" || s.id === "ChestSpine" ? !1 : g[s.id].every((t) => e.includes(t))), [e, r]);
|
|
39
|
+
}, J = (e) => {
|
|
40
|
+
const r = i(() => e.map(u).filter((n) => !!n), [e]);
|
|
41
|
+
return C(r);
|
|
42
|
+
}, F = (e) => i(() => {
|
|
43
|
+
const s = m(), n = e.map(u);
|
|
44
|
+
return s.filter((t) => n.includes(t.id));
|
|
45
|
+
}, [e]), S = (e, r) => i(
|
|
42
46
|
() => e.flatMap(
|
|
43
|
-
(n) =>
|
|
47
|
+
(n) => h(n, r).map((t) => ({
|
|
44
48
|
id: { joint: n },
|
|
45
|
-
plane:
|
|
46
|
-
...
|
|
49
|
+
plane: t,
|
|
50
|
+
...L(n, t)
|
|
47
51
|
}))
|
|
48
52
|
),
|
|
49
|
-
[e,
|
|
50
|
-
),
|
|
53
|
+
[e, r]
|
|
54
|
+
), E = (e, r) => {
|
|
51
55
|
const s = i(() => {
|
|
52
|
-
const
|
|
53
|
-
return e.filter((o) =>
|
|
56
|
+
const t = m();
|
|
57
|
+
return e.filter((o) => t.some((l) => l.id === o));
|
|
54
58
|
}, [e]);
|
|
55
59
|
return i(
|
|
56
60
|
() => s.flatMap(
|
|
57
|
-
(
|
|
58
|
-
id: { segment:
|
|
61
|
+
(t) => x(t, r).map((o) => ({
|
|
62
|
+
id: { segment: t },
|
|
59
63
|
plane: o,
|
|
60
|
-
...
|
|
64
|
+
...P(t, o)
|
|
61
65
|
}))
|
|
62
66
|
),
|
|
63
|
-
[s,
|
|
67
|
+
[s, r]
|
|
64
68
|
);
|
|
65
|
-
},
|
|
66
|
-
const
|
|
69
|
+
}, z = (e) => {
|
|
70
|
+
const r = F(e), s = J(e), n = S(
|
|
67
71
|
s.map((o) => o.id),
|
|
68
72
|
a.Sensor
|
|
69
|
-
),
|
|
70
|
-
|
|
73
|
+
), t = E(
|
|
74
|
+
r.map((o) => o.id),
|
|
71
75
|
a.Sensor
|
|
72
76
|
);
|
|
73
|
-
return [...n, ...
|
|
77
|
+
return [...n, ...t];
|
|
78
|
+
}, k = () => {
|
|
79
|
+
const e = d(v);
|
|
80
|
+
if (e === void 0)
|
|
81
|
+
throw new Error("useUiLabelContext must be used within a UiLabelProvider");
|
|
82
|
+
return e;
|
|
74
83
|
};
|
|
75
84
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
y as useGraphqlClient,
|
|
86
|
+
C as useJointsForLimbIds,
|
|
87
|
+
J as useJointsForSensorLocations,
|
|
88
|
+
F as useLimbsForSensorLocations,
|
|
89
|
+
S as usePartOptionsForJoints,
|
|
90
|
+
E as usePartOptionsForLimbs,
|
|
91
|
+
z as usePartOptionsForSensorLocations,
|
|
92
|
+
k as useUiLabelContext
|
|
83
93
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./other-Dp3RPYfF.cjs");const o=require("./components.cjs"),a=require("./hooks.cjs"),r=require("./providers.cjs"),e=require("./services.cjs"),t=require("./types.cjs"),i=require("./utils.cjs");exports.ActivityList=o.ActivityList;exports.CopyActivityForm=o.CopyActivityForm;exports.CopyModuleForm=o.CopyModuleForm;exports.ModuleForm=o.ModuleForm;exports.ParameterEditList=o.ParameterEditList;exports.ParameterEditSelect=o.ParameterEditSelect;exports.UpsertActivityForm=o.UpsertActivityForm;exports.UpsertModuleForm=o.UpsertModuleForm;exports.useGraphqlClient=a.useGraphqlClient;exports.useJointsForLimbIds=a.useJointsForLimbIds;exports.useJointsForSensorLocations=a.useJointsForSensorLocations;exports.useLimbsForSensorLocations=a.useLimbsForSensorLocations;exports.usePartOptionsForJoints=a.usePartOptionsForJoints;exports.usePartOptionsForLimbs=a.usePartOptionsForLimbs;exports.usePartOptionsForSensorLocations=a.usePartOptionsForSensorLocations;exports.QuantumLibraryProvider=r.QuantumLibraryProvider;exports.UiLabelContext=r.UiLabelContext;exports.UiLabelProvider=r.UiLabelProvider;exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./other-Dp3RPYfF.cjs");const o=require("./components.cjs"),a=require("./hooks.cjs"),r=require("./providers.cjs"),e=require("./services.cjs"),t=require("./types.cjs"),i=require("./utils.cjs");exports.ActivityList=o.ActivityList;exports.CopyActivityForm=o.CopyActivityForm;exports.CopyModuleForm=o.CopyModuleForm;exports.ModuleForm=o.ModuleForm;exports.ParameterEditList=o.ParameterEditList;exports.ParameterEditSelect=o.ParameterEditSelect;exports.UpsertActivityForm=o.UpsertActivityForm;exports.UpsertModuleForm=o.UpsertModuleForm;exports.useGraphqlClient=a.useGraphqlClient;exports.useJointsForLimbIds=a.useJointsForLimbIds;exports.useJointsForSensorLocations=a.useJointsForSensorLocations;exports.useLimbsForSensorLocations=a.useLimbsForSensorLocations;exports.usePartOptionsForJoints=a.usePartOptionsForJoints;exports.usePartOptionsForLimbs=a.usePartOptionsForLimbs;exports.usePartOptionsForSensorLocations=a.usePartOptionsForSensorLocations;exports.useUiLabelContext=a.useUiLabelContext;exports.QuantumLibraryProvider=r.QuantumLibraryProvider;exports.UiLabelContext=r.UiLabelContext;exports.UiLabelProvider=r.UiLabelProvider;exports.getActivityKindFromActivityType=e.getActivityKindFromActivityType;exports.getAllAvailableJoints=e.getAllAvailableJoints;exports.getAllAvailableLimbs=e.getAllAvailableLimbs;exports.getAllAvailablePoseJoints=e.getAllAvailablePoseJoints;exports.getAllAvailablePoseLimbs=e.getAllAvailablePoseLimbs;exports.getAllAvailableSensorJoints=e.getAllAvailableSensorJoints;exports.getAngleDirectionNames=e.getAngleDirectionNames;exports.getAvailableLimbsForLimbIds=e.getAvailableLimbsForLimbIds;exports.getAvailablePoseJointsForLimbIds=e.getAvailablePoseJointsForLimbIds;exports.getAvailableSensorJointsForLimbIds=e.getAvailableSensorJointsForLimbIds;exports.getAxis=e.getAxis;exports.getDefaultAngleSource=e.getDefaultAngleSource;exports.getDefaultJointRange=e.getDefaultJointRange;exports.getDefaultLimbRange=e.getDefaultLimbRange;exports.getEnabledJointPlanes=e.getEnabledJointPlanes;exports.getEnabledSegmentPlanes=e.getEnabledSegmentPlanes;exports.getHumanBodyAngle=e.getHumanBodyAngle;exports.getIsDefaultAngleAllowed=e.getIsDefaultAngleAllowed;exports.getJointAngleDirectionAbbr=e.getJointAngleDirectionAbbr;exports.getJointAngleDirectionName=e.getJointAngleDirectionName;exports.getJointNameWithPlane=e.getJointNameWithPlane;exports.getJointOrSegmentNameWithPlane=e.getJointOrSegmentNameWithPlane;exports.getJointPlaneName=e.getJointPlaneName;exports.getNormativeJointRange=e.getNormativeJointRange;exports.getParameterAngleDirectionName=e.getParameterAngleDirectionName;exports.getParameterDirectionNames=e.getParameterDirectionNames;exports.getPartName=e.getPartName;exports.getPartNameNoSide=e.getPartNameNoSide;exports.getPlane=e.getPlane;exports.getSegmentAngleDirectionAbbr=e.getSegmentAngleDirectionAbbr;exports.getSegmentAngleDirectionName=e.getSegmentAngleDirectionName;exports.getSegmentNameWithPlane=e.getSegmentNameWithPlane;exports.getSegmentXyzName=e.getSegmentXyzName;exports.getTypicalRom=e.getTypicalRom;exports.getTypicalRomSize=e.getTypicalRomSize;exports.isAxis=e.isAxis;exports.isJoint=e.isJoint;exports.isLimb=e.isLimb;exports.isPlane=e.isPlane;exports.jointNames=e.jointNames;exports.jointsUsedByLimbs=e.jointsUsedByLimbs;exports.limbNames=e.limbNames;exports.limbsRequiredForJoints=e.limbsRequiredForJoints;exports.mapActivityTypeEnumToLabel=e.mapActivityTypeEnumToLabel;exports.mapSessionTypeEnumToLabel=e.mapSessionTypeEnumToLabel;exports.mkAccelerationPart=e.mkAccelerationPart;exports.mkAngularVelocityPart=e.mkAngularVelocityPart;exports.mkHumanPart=e.mkHumanPart;exports.mkJointPart=e.mkJointPart;exports.mkLimbPart=e.mkLimbPart;exports.planeOrAxis=e.planeOrAxis;exports.AngleDataSource=t.AngleDataSource;exports.analysisStatBuilder=t.analysisStatBuilder;exports.areThresholdsEmpty=t.areThresholdsEmpty;exports.availablePlanes=t.availablePlanes;exports.axes=t.axes;exports.canBeVerticalForce=t.canBeVerticalForce;exports.dimensionName=t.dimensionName;exports.dimensionToLegacy=t.dimensionToLegacy;exports.getAnalysisName=t.getAnalysisName;exports.getAnalysisPartIdNoSide=t.getAnalysisPartIdNoSide;exports.getJointIdNoSide=t.getJointIdNoSide;exports.getJointIdWithSide=t.getJointIdWithSide;exports.getLimbIdNoSide=t.getLimbIdNoSide;exports.getLimbIdWithSide=t.getLimbIdWithSide;exports.getPointSide=t.getPointSide;exports.isDeviceEqual=t.isDeviceEqual;exports.isLimbTrackingFrame=t.isLimbTrackingFrame;exports.isSyncError=t.isSyncError;exports.jointAngle=t.jointAngle;exports.jointOrLimbHasThreshold=t.jointOrLimbHasThreshold;exports.jointOrLimbThresholdCount=t.jointOrLimbThresholdCount;exports.limbAngle=t.limbAngle;exports.mkUnit=t.mkUnit;exports.partAndPlaneHasThreshold=t.partAndPlaneHasThreshold;exports.partIdName=t.partIdName;exports.partIdToJointLimbId=t.partIdToJointLimbId;exports.partIdToString=t.partIdToString;exports.partKinds=t.partKinds;exports.planes=t.planes;exports.sensorLocationName=t.sensorLocationName;exports.sensorLocationToLimbId=t.sensorLocationToLimbId;exports.thresholdForPart=t.thresholdForPart;exports.thresholdFragmentsToThresholds=t.thresholdFragmentsToThresholds;exports.thresholdsToInput=t.thresholdsToInput;exports.tryMkUnit=t.tryMkUnit;exports.updateThreshold=t.updateThreshold;exports.capitalizeAll=i.capitalizeAll;exports.cn=i.cn;exports.degToRad=i.degToRad;exports.getFormatterForParameter=i.getFormatterForParameter;exports.getUnitFormatted=i.getUnitFormatted;exports.getUnitValueFormatted=i.getUnitValueFormatted;exports.hourMinSecStrToMs=i.hourMinSecStrToMs;exports.inchesToMeters=i.inchesToMeters;exports.kgToPounds=i.kgToPounds;exports.memo=i.memo;exports.metersToInches=i.metersToInches;exports.msToDurationStr=i.msToDurationStr;exports.msToHourMinSecStr=i.msToHourMinSecStr;exports.msToPrettyStr=i.msToPrettyStr;exports.msToTimestampStr=i.msToTimestampStr;exports.parameterToThreshold=i.parameterToThreshold;exports.parametersToThresholds=i.parametersToThresholds;exports.pluralize=i.pluralize;exports.poundsToKg=i.poundsToKg;exports.radToDeg=i.radToDeg;exports.sToTimestampStr=i.sToTimestampStr;exports.safelyConvertEnum=i.safelyConvertEnum;exports.secondsToTimestampStr=i.secondsToTimestampStr;exports.thresholdToParameter=i.thresholdToParameter;exports.thresholdsToParameters=i.thresholdsToParameters;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./other-C4VnLmM6.js";
|
|
2
2
|
import { ActivityList as i, CopyActivityForm as a, CopyModuleForm as r, ModuleForm as n, ParameterEditList as s, ParameterEditSelect as m, UpsertActivityForm as l, UpsertModuleForm as g } from "./components.js";
|
|
3
|
-
import { useGraphqlClient as b, useJointsForLimbIds as A, useJointsForSensorLocations as T, useLimbsForSensorLocations as c, usePartOptionsForJoints as p, usePartOptionsForLimbs as u, usePartOptionsForSensorLocations as P } from "./hooks.js";
|
|
4
|
-
import { QuantumLibraryProvider as
|
|
3
|
+
import { useGraphqlClient as b, useJointsForLimbIds as A, useJointsForSensorLocations as T, useLimbsForSensorLocations as c, usePartOptionsForJoints as p, usePartOptionsForLimbs as u, usePartOptionsForSensorLocations as P, useUiLabelContext as h } from "./hooks.js";
|
|
4
|
+
import { QuantumLibraryProvider as L, UiLabelContext as y, UiLabelProvider as F } from "./providers.js";
|
|
5
5
|
import { getActivityKindFromActivityType as J, getAllAvailableJoints as v, getAllAvailableLimbs as I, getAllAvailablePoseJoints as D, getAllAvailablePoseLimbs as x, getAllAvailableSensorJoints as f, getAngleDirectionNames as E, getAvailableLimbsForLimbIds as U, getAvailablePoseJointsForLimbIds as k, getAvailableSensorJointsForLimbIds as M, getAxis as C, getDefaultAngleSource as O, getDefaultJointRange as R, getDefaultLimbRange as j, getEnabledJointPlanes as H, getEnabledSegmentPlanes as W, getHumanBodyAngle as z, getIsDefaultAngleAllowed as B, getJointAngleDirectionAbbr as q, getJointAngleDirectionName as K, getJointNameWithPlane as V, getJointOrSegmentNameWithPlane as w, getJointPlaneName as G, getNormativeJointRange as Q, getParameterAngleDirectionName as X, getParameterDirectionNames as Y, getPartName as Z, getPartNameNoSide as _, getPlane as $, getSegmentAngleDirectionAbbr as ee, getSegmentAngleDirectionName as te, getSegmentNameWithPlane as oe, getSegmentXyzName as ie, getTypicalRom as ae, getTypicalRomSize as re, isAxis as ne, isJoint as se, isLimb as me, isPlane as le, jointNames as ge, jointsUsedByLimbs as de, limbNames as be, limbsRequiredForJoints as Ae, mapActivityTypeEnumToLabel as Te, mapSessionTypeEnumToLabel as ce, mkAccelerationPart as pe, mkAngularVelocityPart as ue, mkHumanPart as Pe, mkJointPart as he, mkLimbPart as Se, planeOrAxis as Le } from "./services.js";
|
|
6
6
|
import { AngleDataSource as Fe, analysisStatBuilder as Ne, areThresholdsEmpty as Je, availablePlanes as ve, axes as Ie, canBeVerticalForce as De, dimensionName as xe, dimensionToLegacy as fe, getAnalysisName as Ee, getAnalysisPartIdNoSide as Ue, getJointIdNoSide as ke, getJointIdWithSide as Me, getLimbIdNoSide as Ce, getLimbIdWithSide as Oe, getPointSide as Re, isDeviceEqual as je, isLimbTrackingFrame as He, isSyncError as We, jointAngle as ze, jointOrLimbHasThreshold as Be, jointOrLimbThresholdCount as qe, limbAngle as Ke, mkUnit as Ve, partAndPlaneHasThreshold as we, partIdName as Ge, partIdToJointLimbId as Qe, partIdToString as Xe, partKinds as Ye, planes as Ze, sensorLocationName as _e, sensorLocationToLimbId as $e, thresholdForPart as et, thresholdFragmentsToThresholds as tt, thresholdsToInput as ot, tryMkUnit as it, updateThreshold as at } from "./types.js";
|
|
7
7
|
import { capitalizeAll as nt, cn as st, degToRad as mt, getFormatterForParameter as lt, getUnitFormatted as gt, getUnitValueFormatted as dt, hourMinSecStrToMs as bt, inchesToMeters as At, kgToPounds as Tt, memo as ct, metersToInches as pt, msToDurationStr as ut, msToHourMinSecStr as Pt, msToPrettyStr as ht, msToTimestampStr as St, parameterToThreshold as Lt, parametersToThresholds as yt, pluralize as Ft, poundsToKg as Nt, radToDeg as Jt, sToTimestampStr as vt, safelyConvertEnum as It, secondsToTimestampStr as Dt, thresholdToParameter as xt, thresholdsToParameters as ft } from "./utils.js";
|
|
@@ -13,9 +13,9 @@ export {
|
|
|
13
13
|
n as ModuleForm,
|
|
14
14
|
s as ParameterEditList,
|
|
15
15
|
m as ParameterEditSelect,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
L as QuantumLibraryProvider,
|
|
17
|
+
y as UiLabelContext,
|
|
18
|
+
F as UiLabelProvider,
|
|
19
19
|
l as UpsertActivityForm,
|
|
20
20
|
g as UpsertModuleForm,
|
|
21
21
|
Ne as analysisStatBuilder,
|
|
@@ -136,5 +136,5 @@ export {
|
|
|
136
136
|
p as usePartOptionsForJoints,
|
|
137
137
|
u as usePartOptionsForLimbs,
|
|
138
138
|
P as usePartOptionsForSensorLocations,
|
|
139
|
-
|
|
139
|
+
h as useUiLabelContext
|
|
140
140
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useUiLabelContext: () => import('../providers').UiLabelContextType;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
export type UiLabelKey = "module" | "action" | "module_plural" | "action_plural";
|
|
1
2
|
export type UiLabelContextType = {
|
|
2
|
-
getLabel: (value:
|
|
3
|
+
getLabel: (value: UiLabelKey) => string;
|
|
3
4
|
isLoading: boolean;
|
|
4
5
|
};
|
|
5
6
|
export type UiLabelProviderProps = {
|
|
6
7
|
children: React.ReactNode;
|
|
7
8
|
};
|
|
8
9
|
export declare const UiLabelContext: import('react').Context<UiLabelContextType | undefined>;
|
|
9
|
-
export declare const useUiLabelContext: () => UiLabelContextType;
|
package/dist/providers.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./react-jsx-runtime-vendor-Dszzpdy0.cjs"),o=require("./graphql-D4Dr9NG1.cjs"),s=require("react"),l=require("urql"),m=require("@chakra-ui/react"),v=require("./hooks.cjs"),c=require("./generated.cjs"),d=s.createContext(void 0),x=({children:n})=>{const[{data:t,fetching:e}]=l.useQuery({query:o.GET_METADATA_BY_KEY,variables:{key:"ui_label"}}),r=s.useCallback(b=>{if(e)return"Loading...";const u=c.getFragmentData(o.METADATA_GROUP_FRAGMENT,t?.getMetadataByKey);return u?c.getFragmentData(o.METADATA_ITEM_FRAGMENT,u.data).find(g=>g.value===b)?.label??"":""},[t,e]),i=s.useMemo(()=>({getLabel:r,isLoading:e}),[r,e]);return a.jsxRuntimeExports.jsx(d.Provider,{value:i,children:n})},E=({children:n,url:t,getAuthToken:e,chakraProviderProps:r})=>{const i=v.useGraphqlClient({url:t,getAuthToken:e});return a.jsxRuntimeExports.jsx(l.Provider,{value:i,children:a.jsxRuntimeExports.jsx(m.ChakraProvider,{...r,children:a.jsxRuntimeExports.jsx(x,{children:n})})})};exports.QuantumLibraryProvider=E;exports.UiLabelContext=d;exports.UiLabelProvider=x;
|
package/dist/providers.js
CHANGED
|
@@ -1,50 +1,44 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import { createContext as f,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useGraphqlClient as
|
|
1
|
+
import { j as a } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
|
|
2
|
+
import { l as u, c as d, d as c } from "./graphql-D_8ExpKx.js";
|
|
3
|
+
import { createContext as f, useCallback as p, useMemo as A } from "react";
|
|
4
|
+
import { useQuery as v, Provider as x } from "urql";
|
|
5
|
+
import { ChakraProvider as T } from "@chakra-ui/react";
|
|
6
|
+
import { useGraphqlClient as E } from "./hooks.js";
|
|
7
7
|
import { getFragmentData as s } from "./generated.js";
|
|
8
|
-
const
|
|
8
|
+
const b = f(
|
|
9
9
|
void 0
|
|
10
|
-
),
|
|
11
|
-
const e =
|
|
12
|
-
|
|
13
|
-
throw new Error("useUiLabelContext must be used within a UiLabelProvider");
|
|
14
|
-
return e;
|
|
15
|
-
}, C = ({ children: e }) => {
|
|
16
|
-
const [{ data: r, fetching: t }] = E({
|
|
17
|
-
query: x,
|
|
10
|
+
), M = ({ children: o }) => {
|
|
11
|
+
const [{ data: t, fetching: e }] = v({
|
|
12
|
+
query: u,
|
|
18
13
|
variables: { key: "ui_label" }
|
|
19
|
-
}),
|
|
14
|
+
}), r = p(
|
|
20
15
|
(l) => {
|
|
21
|
-
if (
|
|
16
|
+
if (e)
|
|
22
17
|
return "Loading...";
|
|
23
18
|
const n = s(
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
d,
|
|
20
|
+
t?.getMetadataByKey
|
|
26
21
|
);
|
|
27
22
|
return n ? s(
|
|
28
|
-
|
|
23
|
+
c,
|
|
29
24
|
n.data
|
|
30
25
|
).find((m) => m.value === l)?.label ?? "" : "";
|
|
31
26
|
},
|
|
32
|
-
[
|
|
33
|
-
), i =
|
|
27
|
+
[t, e]
|
|
28
|
+
), i = A(
|
|
34
29
|
() => ({
|
|
35
|
-
getLabel:
|
|
36
|
-
isLoading:
|
|
30
|
+
getLabel: r,
|
|
31
|
+
isLoading: e
|
|
37
32
|
}),
|
|
38
|
-
[
|
|
33
|
+
[r, e]
|
|
39
34
|
);
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
},
|
|
42
|
-
const i =
|
|
43
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ a.jsx(b.Provider, { value: i, children: o });
|
|
36
|
+
}, D = ({ children: o, url: t, getAuthToken: e, chakraProviderProps: r }) => {
|
|
37
|
+
const i = E({ url: t, getAuthToken: e });
|
|
38
|
+
return /* @__PURE__ */ a.jsx(x, { value: i, children: /* @__PURE__ */ a.jsx(T, { ...r, children: /* @__PURE__ */ a.jsx(M, { children: o }) }) });
|
|
44
39
|
};
|
|
45
40
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
D as useUiLabelContext
|
|
41
|
+
D as QuantumLibraryProvider,
|
|
42
|
+
b as UiLabelContext,
|
|
43
|
+
M as UiLabelProvider
|
|
50
44
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const ie=require("./react-jsx-runtime-vendor-Dszzpdy0.cjs"),d=require("react"),se=require("./dnd-core-vendor-2Ve0kqUN.cjs"),oe=require("./vendor-BjLvygDR.cjs"),U=d.createContext({dragDropManager:void 0});function m(r,e,...t){if(ae()&&e===void 0)throw new Error("invariant requires an error message argument");if(!r){let i;if(e===void 0)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let n=0;i=new Error(e.replace(/%s/g,function(){return t[n++]})),i.name="Invariant Violation"}throw i.framesToPop=1,i}}function ae(){return typeof process<"u"&&process.env.NODE_ENV==="production"}const k=typeof global<"u"?global:self,Y=k.MutationObserver||k.WebKitMutationObserver;function X(r){return function(){const t=setTimeout(n,0),i=setInterval(n,50);function n(){clearTimeout(t),clearInterval(i),r()}}}function ce(r){let e=1;const t=new Y(r),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){e=-e,i.data=e}}const ue=typeof Y=="function"?ce:X;class de{enqueueTask(e){const{queue:t,requestFlush:i}=this;t.length||(i(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let i=0,n=e.length-this.index;i<n;i++)e[i]=e[i+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=ue(this.flush),this.requestErrorThrow=X(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class le{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}class he{create(e){const t=this.freeTasks,i=t.length?t.pop():new le(this.onError,n=>t[t.length]=n);return i.task=e,i}constructor(e){this.onError=e,this.freeTasks=[]}}const z=new de,ge=new he(z.registerPendingError);function fe(r){z.enqueueTask(ge.create(r))}function pe(r,e){if(r==null)return{};var t=ve(r,e),i,n;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(n=0;n<s.length;n++)i=s[n],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(r,i)&&(t[i]=r[i])}return t}function ve(r,e){if(r==null)return{};var t={},i=Object.keys(r),n,s;for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&(t[n]=r[n]);return t}let _=0;const E=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var De=d.memo(function(e){var{children:t}=e,i=pe(e,["children"]);const[n,s]=me(i);return d.useEffect(()=>{if(s){const a=V();return++_,()=>{--_===0&&(a[E]=null)}}},[]),ie.jsxRuntimeExports.jsx(U.Provider,{value:n,children:t})});function me(r){if("manager"in r)return[{dragDropManager:r.manager},!1];const e=Te(r.backend,r.context,r.options,r.debugMode),t=!r.context;return[e,t]}function Te(r,e=V(),t,i){const n=e;return n[E]||(n[E]={dragDropManager:se.createDragDropManager(r,e,t,i)}),n[E]}function V(){return typeof global<"u"?global:window}const I=typeof window<"u"?d.useLayoutEffect:d.useEffect;function Ie(r,e,t){const[i,n]=d.useState(()=>e(r)),s=d.useCallback(()=>{const a=e(r);oe.equal(i,a)||(n(a),t&&t())},[i,r,t]);return I(s),[i,s]}function Se(r,e,t){const[i,n]=Ie(r,e,t);return I(function(){const a=r.getHandlerId();if(a!=null)return r.subscribeToStateChange(n,{handlerIds:[a]})},[r,n]),i}function W(r,e,t){return Se(e,r||(()=>({})),()=>t.reconnect())}function B(r,e){const t=[];return typeof r!="function"&&t.push(r),d.useMemo(()=>typeof r=="function"?r():r,t)}function Ce(r){return d.useMemo(()=>r.hooks.dragSource(),[r])}function Oe(r){return d.useMemo(()=>r.hooks.dragPreview(),[r])}let y=!1,b=!1;class we{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){m(!y,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return y=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{y=!1}}isDragging(){if(!this.sourceId)return!1;m(!b,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return b=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{b=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let P=!1;class Ee{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;m(!P,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return P=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{P=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function ye(r,e,t){const i=t.getRegistry(),n=i.addTarget(r,e);return[n,()=>i.removeTarget(n)]}function be(r,e,t){const i=t.getRegistry(),n=i.addSource(r,e);return[n,()=>i.removeSource(n)]}function x(r,e,t,i){let n;if(n!==void 0)return!!n;if(r===e)return!0;if(typeof r!="object"||!r||typeof e!="object"||!e)return!1;const s=Object.keys(r),a=Object.keys(e);if(s.length!==a.length)return!1;const o=Object.prototype.hasOwnProperty.bind(e);for(let u=0;u<s.length;u++){const l=s[u];if(!o(l))return!1;const h=r[l],g=e[l];if(n=void 0,n===!1||n===void 0&&h!==g)return!1}return!0}function L(r){return r!==null&&typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"current")}function Pe(r){if(typeof r.type=="string")return;const e=r.type.displayName||r.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function Ne(r){return(e=null,t=null)=>{if(!d.isValidElement(e)){const s=e;return r(s,t),s}const i=e;return Pe(i),Me(i,t?s=>r(s,t):r)}}function K(r){const e={};return Object.keys(r).forEach(t=>{const i=r[t];if(t.endsWith("Ref"))e[t]=r[t];else{const n=Ne(i);e[t]=()=>n}}),e}function F(r,e){typeof r=="function"?r(e):r.current=e}function Me(r,e){const t=r.ref;return m(typeof t!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),t?d.cloneElement(r,{ref:i=>{F(t,i),F(e,i)}}):d.cloneElement(r,{ref:e})}class xe{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,i=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(i&&this.disconnectDragPreview(),!!this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!x(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!x(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=K({dragSource:(t,i)=>{this.clearDragSource(),this.dragSourceOptions=i||null,L(t)?this.dragSourceRef=t:this.dragSourceNode=t,this.reconnectDragSource()},dragPreview:(t,i)=>{this.clearDragPreview(),this.dragPreviewOptions=i||null,L(t)?this.dragPreviewRef=t:this.dragPreviewNode=t,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class Le{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!x(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=K({dropTarget:(t,i)=>{this.clearDropTarget(),this.dropTargetOptions=i,L(t)?this.dropTargetRef=t:this.dropTargetNode=t,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function S(){const{dragDropManager:r}=d.useContext(U);return m(r!=null,"Expected drag drop context"),r}function Re(r,e){const t=S(),i=d.useMemo(()=>new xe(t.getBackend()),[t]);return I(()=>(i.dragSourceOptions=r||null,i.reconnect(),()=>i.disconnectDragSource()),[i,r]),I(()=>(i.dragPreviewOptions=e||null,i.reconnect(),()=>i.disconnectDragPreview()),[i,e]),i}function He(){const r=S();return d.useMemo(()=>new we(r),[r])}class ke{beginDrag(){const e=this.spec,t=this.monitor;let i=null;return typeof e.item=="object"?i=e.item:typeof e.item=="function"?i=e.item(t):i={},i??null}canDrag(){const e=this.spec,t=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(t):!0}isDragging(e,t){const i=this.spec,n=this.monitor,{isDragging:s}=i;return s?s(n):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,i=this.connector,{end:n}=e;n&&n(t.getItem(),t),i.reconnect()}constructor(e,t,i){this.spec=e,this.monitor=t,this.connector=i}}function _e(r,e,t){const i=d.useMemo(()=>new ke(r,e,t),[e,t]);return d.useEffect(()=>{i.spec=r},[r]),i}function Fe(r){return d.useMemo(()=>{const e=r.type;return m(e!=null,"spec.type must be defined"),e},[r])}function qe(r,e,t){const i=S(),n=_e(r,e,t),s=Fe(r);I(function(){if(s!=null){const[o,u]=be(s,n,i);return e.receiveHandlerId(o),t.receiveHandlerId(o),u}},[i,e,t,n,s])}function Ae(r,e){const t=B(r);m(!t.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const i=He(),n=Re(t.options,t.previewOptions);return qe(t,i,n),[W(t.collect,i,n),Ce(n),Oe(n)]}function je(r){return d.useMemo(()=>r.hooks.dropTarget(),[r])}function Ue(r){const e=S(),t=d.useMemo(()=>new Le(e.getBackend()),[e]);return I(()=>(t.dropTargetOptions=r||null,t.reconnect(),()=>t.disconnectDropTarget()),[r]),t}function Ye(){const r=S();return d.useMemo(()=>new Ee(r),[r])}function Xe(r){const{accept:e}=r;return d.useMemo(()=>(m(r.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class ze{canDrop(){const e=this.spec,t=this.monitor;return e.canDrop?e.canDrop(t.getItem(),t):!0}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function Ve(r,e){const t=d.useMemo(()=>new ze(r,e),[e]);return d.useEffect(()=>{t.spec=r},[r]),t}function We(r,e,t){const i=S(),n=Ve(r,e),s=Xe(r);I(function(){const[o,u]=ye(s,n,i);return e.receiveHandlerId(o),t.receiveHandlerId(o),u},[i,e,n,t,s.map(a=>a.toString()).join("|")])}function Be(r,e){const t=B(r),i=Ye(),n=Ue(t.options);return We(t,i,n),[W(t.collect,i,n),je(n)]}function G(r){let e=null;return()=>(e==null&&(e=r()),e)}function Ke(r,e){return r.filter(t=>t!==e)}function Ge(r,e){const t=new Set,i=s=>t.add(s);r.forEach(i),e.forEach(i);const n=[];return t.forEach(s=>n.push(s)),n}class $e{enter(e){const t=this.entered.length,i=n=>this.isNodeInDocument(n)&&(!n.contains||n.contains(e));return this.entered=Ge(this.entered.filter(i),[e]),t===0&&this.entered.length>0}leave(e){const t=this.entered.length;return this.entered=Ke(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class Qe{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach(i=>{const n=this.config.exposeProperties[i];n!=null&&(t[i]={value:n(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const $="__NATIVE_FILE__",Q="__NATIVE_URL__",J="__NATIVE_TEXT__",Z="__NATIVE_HTML__",q=Object.freeze(Object.defineProperty({__proto__:null,FILE:$,HTML:Z,TEXT:J,URL:Q},Symbol.toStringTag,{value:"Module"}));function N(r,e,t){const i=e.reduce((n,s)=>n||r.getData(s),"");return i??t}const R={[$]:{exposeProperties:{files:r=>Array.prototype.slice.call(r.files),items:r=>r.items,dataTransfer:r=>r},matchesTypes:["Files"]},[Z]:{exposeProperties:{html:(r,e)=>N(r,e,""),dataTransfer:r=>r},matchesTypes:["Html","text/html"]},[Q]:{exposeProperties:{urls:(r,e)=>N(r,e,"").split(`
|
|
1
|
+
"use strict";const ie=require("./react-jsx-runtime-vendor-Dszzpdy0.cjs"),d=require("react"),se=require("./dnd-core-vendor-qc3HexmT.cjs"),oe=require("./vendor-BruMPwbF.cjs"),U=d.createContext({dragDropManager:void 0});function m(r,e,...t){if(ae()&&e===void 0)throw new Error("invariant requires an error message argument");if(!r){let i;if(e===void 0)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let n=0;i=new Error(e.replace(/%s/g,function(){return t[n++]})),i.name="Invariant Violation"}throw i.framesToPop=1,i}}function ae(){return typeof process<"u"&&process.env.NODE_ENV==="production"}const k=typeof global<"u"?global:self,Y=k.MutationObserver||k.WebKitMutationObserver;function X(r){return function(){const t=setTimeout(n,0),i=setInterval(n,50);function n(){clearTimeout(t),clearInterval(i),r()}}}function ce(r){let e=1;const t=new Y(r),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){e=-e,i.data=e}}const ue=typeof Y=="function"?ce:X;class de{enqueueTask(e){const{queue:t,requestFlush:i}=this;t.length||(i(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let i=0,n=e.length-this.index;i<n;i++)e[i]=e[i+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=ue(this.flush),this.requestErrorThrow=X(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class le{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}class he{create(e){const t=this.freeTasks,i=t.length?t.pop():new le(this.onError,n=>t[t.length]=n);return i.task=e,i}constructor(e){this.onError=e,this.freeTasks=[]}}const z=new de,ge=new he(z.registerPendingError);function fe(r){z.enqueueTask(ge.create(r))}function pe(r,e){if(r==null)return{};var t=ve(r,e),i,n;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(n=0;n<s.length;n++)i=s[n],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(r,i)&&(t[i]=r[i])}return t}function ve(r,e){if(r==null)return{};var t={},i=Object.keys(r),n,s;for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&(t[n]=r[n]);return t}let _=0;const E=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var De=d.memo(function(e){var{children:t}=e,i=pe(e,["children"]);const[n,s]=me(i);return d.useEffect(()=>{if(s){const a=V();return++_,()=>{--_===0&&(a[E]=null)}}},[]),ie.jsxRuntimeExports.jsx(U.Provider,{value:n,children:t})});function me(r){if("manager"in r)return[{dragDropManager:r.manager},!1];const e=Te(r.backend,r.context,r.options,r.debugMode),t=!r.context;return[e,t]}function Te(r,e=V(),t,i){const n=e;return n[E]||(n[E]={dragDropManager:se.createDragDropManager(r,e,t,i)}),n[E]}function V(){return typeof global<"u"?global:window}const I=typeof window<"u"?d.useLayoutEffect:d.useEffect;function Ie(r,e,t){const[i,n]=d.useState(()=>e(r)),s=d.useCallback(()=>{const a=e(r);oe.equal(i,a)||(n(a),t&&t())},[i,r,t]);return I(s),[i,s]}function Se(r,e,t){const[i,n]=Ie(r,e,t);return I(function(){const a=r.getHandlerId();if(a!=null)return r.subscribeToStateChange(n,{handlerIds:[a]})},[r,n]),i}function W(r,e,t){return Se(e,r||(()=>({})),()=>t.reconnect())}function B(r,e){const t=[];return typeof r!="function"&&t.push(r),d.useMemo(()=>typeof r=="function"?r():r,t)}function Ce(r){return d.useMemo(()=>r.hooks.dragSource(),[r])}function Oe(r){return d.useMemo(()=>r.hooks.dragPreview(),[r])}let y=!1,b=!1;class we{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){m(!y,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return y=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{y=!1}}isDragging(){if(!this.sourceId)return!1;m(!b,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return b=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{b=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let P=!1;class Ee{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;m(!P,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return P=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{P=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function ye(r,e,t){const i=t.getRegistry(),n=i.addTarget(r,e);return[n,()=>i.removeTarget(n)]}function be(r,e,t){const i=t.getRegistry(),n=i.addSource(r,e);return[n,()=>i.removeSource(n)]}function x(r,e,t,i){let n;if(n!==void 0)return!!n;if(r===e)return!0;if(typeof r!="object"||!r||typeof e!="object"||!e)return!1;const s=Object.keys(r),a=Object.keys(e);if(s.length!==a.length)return!1;const o=Object.prototype.hasOwnProperty.bind(e);for(let u=0;u<s.length;u++){const l=s[u];if(!o(l))return!1;const h=r[l],g=e[l];if(n=void 0,n===!1||n===void 0&&h!==g)return!1}return!0}function L(r){return r!==null&&typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"current")}function Pe(r){if(typeof r.type=="string")return;const e=r.type.displayName||r.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function Ne(r){return(e=null,t=null)=>{if(!d.isValidElement(e)){const s=e;return r(s,t),s}const i=e;return Pe(i),Me(i,t?s=>r(s,t):r)}}function K(r){const e={};return Object.keys(r).forEach(t=>{const i=r[t];if(t.endsWith("Ref"))e[t]=r[t];else{const n=Ne(i);e[t]=()=>n}}),e}function F(r,e){typeof r=="function"?r(e):r.current=e}function Me(r,e){const t=r.ref;return m(typeof t!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),t?d.cloneElement(r,{ref:i=>{F(t,i),F(e,i)}}):d.cloneElement(r,{ref:e})}class xe{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,i=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(i&&this.disconnectDragPreview(),!!this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!x(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!x(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=K({dragSource:(t,i)=>{this.clearDragSource(),this.dragSourceOptions=i||null,L(t)?this.dragSourceRef=t:this.dragSourceNode=t,this.reconnectDragSource()},dragPreview:(t,i)=>{this.clearDragPreview(),this.dragPreviewOptions=i||null,L(t)?this.dragPreviewRef=t:this.dragPreviewNode=t,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class Le{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!x(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=K({dropTarget:(t,i)=>{this.clearDropTarget(),this.dropTargetOptions=i,L(t)?this.dropTargetRef=t:this.dropTargetNode=t,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function S(){const{dragDropManager:r}=d.useContext(U);return m(r!=null,"Expected drag drop context"),r}function Re(r,e){const t=S(),i=d.useMemo(()=>new xe(t.getBackend()),[t]);return I(()=>(i.dragSourceOptions=r||null,i.reconnect(),()=>i.disconnectDragSource()),[i,r]),I(()=>(i.dragPreviewOptions=e||null,i.reconnect(),()=>i.disconnectDragPreview()),[i,e]),i}function He(){const r=S();return d.useMemo(()=>new we(r),[r])}class ke{beginDrag(){const e=this.spec,t=this.monitor;let i=null;return typeof e.item=="object"?i=e.item:typeof e.item=="function"?i=e.item(t):i={},i??null}canDrag(){const e=this.spec,t=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(t):!0}isDragging(e,t){const i=this.spec,n=this.monitor,{isDragging:s}=i;return s?s(n):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,i=this.connector,{end:n}=e;n&&n(t.getItem(),t),i.reconnect()}constructor(e,t,i){this.spec=e,this.monitor=t,this.connector=i}}function _e(r,e,t){const i=d.useMemo(()=>new ke(r,e,t),[e,t]);return d.useEffect(()=>{i.spec=r},[r]),i}function Fe(r){return d.useMemo(()=>{const e=r.type;return m(e!=null,"spec.type must be defined"),e},[r])}function qe(r,e,t){const i=S(),n=_e(r,e,t),s=Fe(r);I(function(){if(s!=null){const[o,u]=be(s,n,i);return e.receiveHandlerId(o),t.receiveHandlerId(o),u}},[i,e,t,n,s])}function Ae(r,e){const t=B(r);m(!t.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const i=He(),n=Re(t.options,t.previewOptions);return qe(t,i,n),[W(t.collect,i,n),Ce(n),Oe(n)]}function je(r){return d.useMemo(()=>r.hooks.dropTarget(),[r])}function Ue(r){const e=S(),t=d.useMemo(()=>new Le(e.getBackend()),[e]);return I(()=>(t.dropTargetOptions=r||null,t.reconnect(),()=>t.disconnectDropTarget()),[r]),t}function Ye(){const r=S();return d.useMemo(()=>new Ee(r),[r])}function Xe(r){const{accept:e}=r;return d.useMemo(()=>(m(r.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class ze{canDrop(){const e=this.spec,t=this.monitor;return e.canDrop?e.canDrop(t.getItem(),t):!0}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function Ve(r,e){const t=d.useMemo(()=>new ze(r,e),[e]);return d.useEffect(()=>{t.spec=r},[r]),t}function We(r,e,t){const i=S(),n=Ve(r,e),s=Xe(r);I(function(){const[o,u]=ye(s,n,i);return e.receiveHandlerId(o),t.receiveHandlerId(o),u},[i,e,n,t,s.map(a=>a.toString()).join("|")])}function Be(r,e){const t=B(r),i=Ye(),n=Ue(t.options);return We(t,i,n),[W(t.collect,i,n),je(n)]}function G(r){let e=null;return()=>(e==null&&(e=r()),e)}function Ke(r,e){return r.filter(t=>t!==e)}function Ge(r,e){const t=new Set,i=s=>t.add(s);r.forEach(i),e.forEach(i);const n=[];return t.forEach(s=>n.push(s)),n}class $e{enter(e){const t=this.entered.length,i=n=>this.isNodeInDocument(n)&&(!n.contains||n.contains(e));return this.entered=Ge(this.entered.filter(i),[e]),t===0&&this.entered.length>0}leave(e){const t=this.entered.length;return this.entered=Ke(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class Qe{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach(i=>{const n=this.config.exposeProperties[i];n!=null&&(t[i]={value:n(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const $="__NATIVE_FILE__",Q="__NATIVE_URL__",J="__NATIVE_TEXT__",Z="__NATIVE_HTML__",q=Object.freeze(Object.defineProperty({__proto__:null,FILE:$,HTML:Z,TEXT:J,URL:Q},Symbol.toStringTag,{value:"Module"}));function N(r,e,t){const i=e.reduce((n,s)=>n||r.getData(s),"");return i??t}const R={[$]:{exposeProperties:{files:r=>Array.prototype.slice.call(r.files),items:r=>r.items,dataTransfer:r=>r},matchesTypes:["Files"]},[Z]:{exposeProperties:{html:(r,e)=>N(r,e,""),dataTransfer:r=>r},matchesTypes:["Html","text/html"]},[Q]:{exposeProperties:{urls:(r,e)=>N(r,e,"").split(`
|
|
2
2
|
`),dataTransfer:r=>r},matchesTypes:["Url","text/uri-list"]},[J]:{exposeProperties:{text:(r,e)=>N(r,e,""),dataTransfer:r=>r},matchesTypes:["Text","text/plain"]}};function Je(r,e){const t=R[r];if(!t)throw new Error(`native type ${r} has no configuration`);const i=new Qe(t);return i.loadDataTransfer(e),i}function M(r){if(!r)return null;const e=Array.prototype.slice.call(r.types||[]);return Object.keys(R).filter(t=>{const i=R[t];return i?.matchesTypes?i.matchesTypes.some(n=>e.indexOf(n)>-1):!1})[0]||null}const Ze=G(()=>/firefox/i.test(navigator.userAgent)),ee=G(()=>!!window.safari);class A{interpolate(e){const{xs:t,ys:i,c1s:n,c2s:s,c3s:a}=this;let o=t.length-1;if(e===t[o])return i[o];let u=0,l=a.length-1,h;for(;u<=l;){h=Math.floor(.5*(u+l));const c=t[h];if(c<e)u=h+1;else if(c>e)l=h-1;else return i[h]}o=Math.max(0,l);const g=e-t[o],f=g*g;return i[o]+n[o]*g+s[o]*f+a[o]*g*f}constructor(e,t){const{length:i}=e,n=[];for(let c=0;c<i;c++)n.push(c);n.sort((c,p)=>e[c]<e[p]?-1:1);const s=[],a=[];let o,u;for(let c=0;c<i-1;c++)o=e[c+1]-e[c],u=t[c+1]-t[c],s.push(o),a.push(u/o);const l=[a[0]];for(let c=0;c<s.length-1;c++){const p=a[c],v=a[c+1];if(p*v<=0)l.push(0);else{o=s[c];const D=s[c+1],T=o+D;l.push(3*T/((T+D)/p+(T+o)/v))}}l.push(a[a.length-1]);const h=[],g=[];let f;for(let c=0;c<l.length-1;c++){f=a[c];const p=l[c],v=1/s[c],D=p+l[c+1]-f-f;h.push((f-p-D)*v),g.push(D*v*v)}this.xs=e,this.ys=t,this.c1s=l,this.c2s=h,this.c3s=g}}const et=1;function te(r){const e=r.nodeType===et?r:r.parentElement;if(!e)return null;const{top:t,left:i}=e.getBoundingClientRect();return{x:i,y:t}}function w(r){return{x:r.clientX,y:r.clientY}}function tt(r){var e;return r.nodeName==="IMG"&&(Ze()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(r)))}function rt(r,e,t,i){let n=r?e.width:t,s=r?e.height:i;return ee()&&r&&(s/=window.devicePixelRatio,n/=window.devicePixelRatio),{dragPreviewWidth:n,dragPreviewHeight:s}}function nt(r,e,t,i,n){const s=tt(e),o=te(s?r:e),u={x:t.x-o.x,y:t.y-o.y},{offsetWidth:l,offsetHeight:h}=r,{anchorX:g,anchorY:f}=i,{dragPreviewWidth:c,dragPreviewHeight:p}=rt(s,e,l,h),v=()=>{let H=new A([0,.5,1],[u.y,u.y/h*p,u.y+p-h]).interpolate(f);return ee()&&s&&(H+=(window.devicePixelRatio-1)*p),H},D=()=>new A([0,.5,1],[u.x,u.x/l*c,u.x+c-l]).interpolate(g),{offsetX:T,offsetY:C}=n,O=T===0||T,re=C===0||C;return{x:O?T:D(),y:re?C:v()}}class it{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}}function st(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function j(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),i.forEach(function(n){st(r,n,t[n])})}return r}class ot{profile(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((t=this.dragOverTargetIds)===null||t===void 0?void 0:t.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var t;(t=this.window)===null||t===void 0||t.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,t,i){return this.sourcePreviewNodeOptions.set(e,i),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,i){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,i);const n=a=>this.handleDragStart(a,e),s=a=>this.handleSelectStart(a);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",n),t.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",n),t.removeEventListener("selectstart",s),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const i=a=>this.handleDragEnter(a,e),n=a=>this.handleDragOver(a,e),s=a=>this.handleDrop(a,e);return t.addEventListener("dragenter",i),t.addEventListener("dragover",n),t.addEventListener("drop",s),()=>{t.removeEventListener("dragenter",i),t.removeEventListener("dragover",n),t.removeEventListener("drop",s)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return j({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions.get(e);return j({anchorX:.5,anchorY:.5,captureDraggingState:!1},t||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(q).some(t=>q[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=Je(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const t=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var i;return(i=this.rootElement)===null||i===void 0?void 0:i.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},t)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,i){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=n=>{const s=this.sourceNodes.get(n);return s&&te(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=n=>!!(n&&this.document&&this.document.body&&this.document.body.contains(n)),this.endDragIfSourceWasRemovedFromDOM=()=>{const n=this.currentDragSourceNode;n==null||this.isNodeInDocument(n)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=n=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(n||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=n=>{if(n.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const a=w(n);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:o}=n,u=M(o);if(this.monitor.isDragging()){if(o&&typeof o.setDragImage=="function"){const h=this.monitor.getSourceId(),g=this.sourceNodes.get(h),f=this.sourcePreviewNodes.get(h)||g;if(f){const{anchorX:c,anchorY:p,offsetX:v,offsetY:D}=this.getCurrentSourcePreviewNodeOptions(),O=nt(g,f,a,{anchorX:c,anchorY:p},{offsetX:v,offsetY:D});o.setDragImage(f,O.x,O.y)}}try{o?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(n.target);const{captureDraggingState:l}=this.getCurrentSourcePreviewNodeOptions();l?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(u)this.beginDragNativeItem(u);else{if(o&&!o.types&&(n.target&&!n.target.hasAttribute||!n.target.hasAttribute("draggable")))return;n.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=n=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(n.dataTransfer)}if(!this.enterLeaveCounter.enter(n.target)||this.monitor.isDragging())return;const{dataTransfer:o}=n,u=M(o);u&&this.beginDragNativeItem(u,o)},this.handleTopDragEnter=n=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=n.altKey,s.length>0&&this.actions.hover(s,{clientOffset:w(n)}),s.some(o=>this.monitor.canDropOnTarget(o))&&(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=n=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(n.dataTransfer)}},this.handleTopDragOver=n=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect="none");return}this.altKeyPressed=n.altKey,this.lastClientOffset=w(n),this.scheduleHover(s),(s||[]).some(o=>this.monitor.canDropOnTarget(o))?(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?n.preventDefault():(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=n=>{this.isDraggingNativeItem()&&n.preventDefault(),this.enterLeaveCounter.leave(n.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=n=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;n.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(n.dataTransfer)}else M(n.dataTransfer)&&n.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=n=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:w(n)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=n=>{const s=n.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(n.preventDefault(),s.dragDrop()))},this.options=new it(t,i),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new $e(this.isNodeInDocument)}}const at=function(e,t,i){return new ot(e,t,i)};exports.DndProvider=De;exports.HTML5Backend=at;exports.asap=fe;exports.invariant=m;exports.useDrag=Ae;exports.useDrop=Be;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as oe } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
|
|
2
2
|
import { createContext as ae, memo as ce, useEffect as y, useLayoutEffect as ue, useState as de, useCallback as le, useMemo as p, isValidElement as he, cloneElement as k, useContext as ge } from "react";
|
|
3
|
-
import { c as fe } from "./dnd-core-vendor-
|
|
4
|
-
import {
|
|
3
|
+
import { c as fe } from "./dnd-core-vendor-P5FwdnRw.js";
|
|
4
|
+
import { e as pe } from "./vendor-DJTRwKAQ.js";
|
|
5
5
|
const X = ae({
|
|
6
6
|
dragDropManager: void 0
|
|
7
7
|
});
|
|
@@ -4,7 +4,7 @@ import { _ as ee, a as D, b as f, c as jt, d as me, e as x, f as Ut, g as Qt, h
|
|
|
4
4
|
import { j as A, c as gt, k as qt } from "./emotion-react-vendor-CSrsXjBq.js";
|
|
5
5
|
import { createPortal as en } from "react-dom";
|
|
6
6
|
import { a as tn } from "./floating-ui-vendor-BcB50aec.js";
|
|
7
|
-
import {
|
|
7
|
+
import { i as Je, g as nn } from "./vendor-DJTRwKAQ.js";
|
|
8
8
|
import { useTheme as bt, useFormControl as un, useMultiStyleConfig as ae, Box as L, useColorModeValue as Qe, MenuIcon as an, chakra as ze, Menu as on, Spinner as rn, Divider as ln, useStyleConfig as sn, useBreakpointValue as cn, Icon as ke } from "@chakra-ui/react";
|
|
9
9
|
import { j as S } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
|
|
10
10
|
var dn = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
|