allyhub 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/render.js +1 -1
- package/dist/commands/sheet.js +7 -7
- package/dist/commands/slides.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
- package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
- package/dist/node_modules/@allyhub-next/build/package.json +1 -1
- package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
- package/dist/node_modules/@allyhub-next/check/package.json +1 -1
- package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub-next/components/package.json +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/exports.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
- package/dist/node_modules/@allyhub-next/export/dist/export.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/export/dist/export.js +4 -4
- package/dist/node_modules/@allyhub-next/export/dist/names.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/export/package.json +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +179 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +303 -11
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +135 -3
- package/dist/node_modules/@allyhub-next/formats/dist/zip.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/formats/dist/zip.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/package.json +1 -1
- package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
- package/dist/node_modules/@allyhub-next/media/package.json +1 -1
- package/dist/node_modules/@allyhub-next/model/package.json +1 -1
- package/dist/node_modules/@allyhub-next/project/package.json +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
- package/dist/node_modules/@allyhub-next/render/dist/exports.d.ts +2 -11
- package/dist/node_modules/@allyhub-next/render/dist/exports.js +2 -2
- package/dist/node_modules/@allyhub-next/render/dist/page.d.ts +1 -9
- package/dist/node_modules/@allyhub-next/render/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/page.d.ts +83 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/page.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.d.ts +40 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub-next/site/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +64 -7
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-file.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +20 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +37 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/preset.d.ts +5 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/preset.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +7 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.d.ts +6 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +11 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.d.ts +10 -4
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub-next/stage/dist/graphics.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
- package/dist/node_modules/@allyhub-next/stage-page/dist/page.js +19 -19
- package/dist/node_modules/@allyhub-next/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
- package/editor-web/assets/dist-BW2s9FMO.js +4 -0
- package/editor-web/assets/{dist-CuW84oPe.js → dist-C-6JmebI.js} +22 -22
- package/editor-web/assets/dist-CCYMLMKN.js +6 -0
- package/editor-web/assets/dist-CHzurjMx.js +33 -0
- package/editor-web/assets/{dist-Yi3sy7Ea.js → dist-DF7H1dxw.js} +1 -1
- package/editor-web/assets/dist-Da5AUSKX.js +2 -0
- package/editor-web/assets/index-CovQYWvD.js +69 -0
- package/editor-web/assets/minus-BrvjaJyO.js +1 -0
- package/editor-web/assets/react-DV5fPdiH.js +101 -0
- package/editor-web/assets/{textarea-CvxipnGW.js → textarea-B0vCGdZI.js} +2 -2
- package/editor-web/assets/{trash-2-Bq1Dt8XG.js → trash-2-B0dvc1cZ.js} +1 -1
- package/editor-web/assets/{undo-2-Djhvu4xt.js → undo-2-A1EPubPO.js} +1 -1
- package/editor-web/index.html +2 -2
- package/package.json +2 -2
- package/editor-web/assets/dist-Cg2PdedY.js +0 -6
- package/editor-web/assets/dist-CxAS_vp7.js +0 -2
- package/editor-web/assets/dist-DCVaj9i1.js +0 -4
- package/editor-web/assets/dist-DGVUuVPB.js +0 -33
- package/editor-web/assets/index-pwRfZ2Jv.js +0 -69
- package/editor-web/assets/minus-BizJdinJ.js +0 -1
- package/editor-web/assets/react-D54s6gwK.js +0 -101
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./rolldown-runtime-XKyaHtl9.js";import{
|
|
1
|
+
import"./rolldown-runtime-XKyaHtl9.js";import{Bt as e,Pt as t,Vt as n,gn as r}from"./react-DV5fPdiH.js";var i=e(`baseline`,[[`path`,{d:`M4 20h16`,key:`14thso`}],[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),a=e(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),o=e(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),s=e(`paint-bucket`,[[`path`,{d:`M11 7 6 2`,key:`1jwth8`}],[`path`,{d:`M18.992 12H2.041`,key:`xw1gg`}],[`path`,{d:`M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595`,key:`1nkol4`}],[`path`,{d:`m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33`,key:`1nk1rd`}]]),c=e(`redo-2`,[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]),l=Symbol.for(`yaml.alias`),u=Symbol.for(`yaml.document`),d=Symbol.for(`yaml.map`),f=Symbol.for(`yaml.pair`),p=Symbol.for(`yaml.scalar`),m=Symbol.for(`yaml.seq`),h=Symbol.for(`yaml.node.type`),g=e=>!!e&&typeof e==`object`&&e[h]===l,_=e=>!!e&&typeof e==`object`&&e[h]===u,v=e=>!!e&&typeof e==`object`&&e[h]===d,y=e=>!!e&&typeof e==`object`&&e[h]===f,b=e=>!!e&&typeof e==`object`&&e[h]===p,x=e=>!!e&&typeof e==`object`&&e[h]===m;function S(e){if(e&&typeof e==`object`)switch(e[h]){case d:case m:return!0}return!1}function C(e){if(e&&typeof e==`object`)switch(e[h]){case l:case d:case p:case m:return!0}return!1}var ee=e=>(b(e)||S(e))&&!!e.anchor,w=Symbol(`break visit`),T=Symbol(`skip children`),E=Symbol(`remove node`);function D(e,t){let n=te(t);_(e)?O(null,e.contents,n,Object.freeze([e]))===E&&(e.contents=null):O(null,e,n,Object.freeze([]))}D.BREAK=w,D.SKIP=T,D.REMOVE=E;function O(e,t,n,r){let i=ne(e,t,n,r);if(C(i)||y(i))return re(e,r,i),O(e,i,n,r);if(typeof i!=`symbol`){if(S(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=O(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===w)return w;else i===E&&(t.items.splice(e,1),--e)}}else if(y(t)){r=Object.freeze(r.concat(t));let e=O(`key`,t.key,n,r);if(e===w)return w;e===E&&(t.key=null);let i=O(`value`,t.value,n,r);if(i===w)return w;i===E&&(t.value=null)}}return i}function te(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function ne(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(v(t))return n.Map?.(e,t,r);if(x(t))return n.Seq?.(e,t,r);if(y(t))return n.Pair?.(e,t,r);if(b(t))return n.Scalar?.(e,t,r);if(g(t))return n.Alias?.(e,t,r)}function re(e,t,n){let r=t[t.length-1];if(S(r))r.items[e]=n;else if(y(r))e===`key`?r.key=n:r.value=n;else if(_(r))r.contents=n;else{let e=g(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var ie={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},ae=e=>e.replace(/[!,[\]{}]/g,e=>ie[e]),k=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ae(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&C(e.contents)){let t={};D(e.contents,(e,n)=>{C(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||e&&!r.some(e=>e.startsWith(a))||t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
2
2
|
`)}};k.defaultYaml={explicit:!1,version:`1.2`},k.defaultTags={"!!":`tag:yaml.org,2002:`};function oe(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function se(e){let t=new Set;return D(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function ce(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function le(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=se(e);let a=ce(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(b(t.node)||S(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function A(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=A(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=A(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=A(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=A(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function j(e,t,n){if(Array.isArray(e))return e.map((e,t)=>j(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!ee(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var ue=class{constructor(e){Object.defineProperty(this,h,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!_(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=j(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?A(i,{"":o},``,o):o}},de=class extends ue{constructor(e){super(l),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],D(e,{Node:(e,t)=>{(g(t)||ee(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(j(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=fe(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(oe(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function fe(e,t,n){if(g(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(S(t)){let r=0;for(let i of t.items){let t=fe(e,i,n);t>r&&(r=t)}return r}if(y(t)){let r=fe(e,t.key,n),i=fe(e,t.value,n);return Math.max(r,i)}return 1}var pe=e=>!e||typeof e!=`function`&&typeof e!=`object`,M=class extends ue{constructor(e){super(p),this.value=e}toJSON(e,t){return t?.keep?this.value:j(this.value,e,t)}toString(){return String(this.value)}};M.BLOCK_FOLDED=`BLOCK_FOLDED`,M.BLOCK_LITERAL=`BLOCK_LITERAL`,M.PLAIN=`PLAIN`,M.QUOTE_DOUBLE=`QUOTE_DOUBLE`,M.QUOTE_SINGLE=`QUOTE_SINGLE`;var me=`tag:yaml.org,2002:`;function he(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function ge(e,t,n){if(_(e)&&(e=e.contents),C(e))return e;if(y(e)){let t=n.schema[d].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new de(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=me+t.slice(2));let l=he(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new M(e);return c&&(c.node=t),t}l=e instanceof Map?o[d]:Symbol.iterator in Object(e)?o[m]:o[d]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new M(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function _e(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return ge(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var ve=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,ye=class extends ue{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>C(t)||y(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ve(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(S(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,_e(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(S(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&b(i)?i.value:i:S(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!y(t))return!1;let n=t.value;return n==null||e&&b(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return S(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(S(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,_e(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},be=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function N(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var P=(e,t,n)=>e.endsWith(`
|
|
3
3
|
`)?N(n,t):n.includes(`
|
|
4
4
|
`)?`
|
|
@@ -102,4 +102,4 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
102
102
|
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
103
103
|
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Yn(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(Q(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=$(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(qn(t.key)&&!Q(t.sep,`newline`)){let e=$(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Q(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!Q(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Yn(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||Q(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=$(Jn(t));Xn(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
104
104
|
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
105
|
-
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=$(Jn(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=$(Jn(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Qn(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Gn||null,prettyErrors:t}}function $n(e,t={}){let{lineCounter:n,prettyErrors:r}=Qn(t),i=new Zn(n?.addNewLine),a=new Nn(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Xt(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Qt(e,n)),o.warnings.forEach(Qt(e,n))),o}var er=n();r();function tr({className:
|
|
105
|
+
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=$(Jn(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=$(Jn(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Qn(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Gn||null,prettyErrors:t}}function $n(e,t={}){let{lineCounter:n,prettyErrors:r}=Qn(t),i=new Zn(n?.addNewLine),a=new Nn(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Xt(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Qt(e,n)),o.warnings.forEach(Qt(e,n))),o}var er=n();r();function tr({className:e,...n}){return(0,er.jsx)(`textarea`,{"data-slot":`textarea`,className:t(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40`,e),...n})}export{v as a,c,a as d,i as f,Jt as i,s as l,$n as n,b as o,Gn as r,x as s,tr as t,o as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Bt as e}from"./react-DV5fPdiH.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),n=e(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),r=e(`text-align-justify`,[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]]),i=e(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);export{t as i,r as n,n as r,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Bt as e}from"./react-DV5fPdiH.js";var t=e(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),n=e(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),r=e(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),i=e(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]);export{t as i,r as n,n as r,i as t};
|
package/editor-web/index.html
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>AllyHub</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CovQYWvD.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/react-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/react-DV5fPdiH.js">
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/index-B7S9RZhL.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allyhub",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "allyhub: what an agent runs to check, render, measure and look at a project's content, in any agent app.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://allyhub.com",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"node": ">=22.19"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@allyhub/sdk": "0.
|
|
51
|
+
"@allyhub/sdk": "0.6.0",
|
|
52
52
|
"@fontsource-variable/commissioner": "^5.3.0",
|
|
53
53
|
"@fontsource-variable/inter": "^5.3.0",
|
|
54
54
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,Ct as n,Dt as r,Et as i,G as a,J as o,K as s,Ot as c,Q as l,Rt as u,Tt as d,X as f,Xt as p,Y as m,Z as h,at as g,bt as _,c as v,ct as y,d as b,dt as x,et as S,f as C,ft as w,gt as T,ht as E,i as ee,it as D,jt as O,kt as k,l as A,lt as j,mt as M,n as N,nn as P,nt as te,ot as ne,pt as F,q as I,r as L,rn as R,rt as z,s as re,st as ie,tt as ae,u as oe,ut as se,vt as ce}from"./react-D54s6gwK.js";var le=6,ue=.85,de=.25,fe=40,pe=12,me=(e,t,n)=>Math.min(n,Math.max(t,e));function he(e){let t=e.map(e=>e.x),n=e.map(e=>e.y),r=Math.min(...t),i=Math.min(...n);return{x:r,y:i,width:Math.max(...t)-r,height:Math.max(...n)-i}}function ge(e){let[t]=e,n=e.at(-1);if(!t||!n)return!1;let{width:r,height:i}=he(e),a=Math.hypot(r,i);return a>0&&Math.hypot(n.x-t.x,n.y-t.y)<=a*de}var _e=(e,t)=>e.x<t.x+Math.max(t.width,1)&&e.x+Math.max(e.width,1)>t.x&&e.y<t.y+Math.max(t.height,1)&&e.y+Math.max(e.height,1)>t.y;function ve(e,t){let n=e.width/2||1,r=e.height/2||1,i=e.x+n,a=e.y+r,o=(me(i,t.x,t.x+t.width)-i)/n,s=(me(a,t.y,t.y+t.height)-a)/r;return Math.hypot(o,s)<=ue}function ye(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=0,o=1;for(let[t,s]of[[-r,e.x-n.x],[r,n.x+n.width-e.x],[-i,e.y-n.y],[i,n.y+n.height-e.y]]){if(t===0){if(s<0)return!1}else t<0?a=Math.max(a,s/t):o=Math.min(o,s/t);if(a>o)return!1}return!0}function be(e,t){switch(e.kind){case`box`:return _e(e.rect,t);case`round`:return ve(e.rect,t);case`arrow`:return _e({x:e.to.x-le,y:e.to.y-le,width:12,height:12},t);case`line`:return ge(e.points)?ve(he(e.points),t):e.points.some((n,r)=>ye(e.points[r-1]??n,n,t))}}function xe(e,t){return t.flatMap(n=>t.map(t=>({x:e.x+e.width*t,y:e.y+e.height*n})))}function Se(e){let t=e.map((t,n)=>{let r=e[n-1]??t;return Math.hypot(t.x-r.x,t.y-r.y)}),n=t.reduce((e,t)=>e+t,0),r=me(Math.ceil(n/fe)+1,2,pe);return Array.from({length:r},(i,a)=>{let o=n*a/(r-1);for(let[n,r]of e.entries()){let i=t[n]??0,a=e[n-1];if(a&&o<=i){let e=i===0?0:o/i;return{x:a.x+(r.x-a.x)*e,y:a.y+(r.y-a.y)*e}}o-=i}return e.at(-1)??{x:0,y:0}})}function Ce(e){switch(e.kind){case`box`:return xe(e.rect,[.5,.2,.8]);case`round`:return xe(e.rect,[.5,.3,.7]);case`arrow`:return[e.to];case`line`:return ge(e.points)?xe(he(e.points),[.5,.3,.7]):Se(e.points)}}function we(e,t){switch(e.kind){case`box`:case`round`:{let n=t(e.rect),r=t({x:e.rect.x+e.rect.width,y:e.rect.y+e.rect.height});return{kind:e.kind,rect:{...n,width:r.x-n.x,height:r.y-n.y}}}case`arrow`:return{kind:`arrow`,from:t(e.from),to:t(e.to)};case`line`:return{kind:`line`,points:e.points.map(t)}}}var Te=c(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ee=c(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),De=c(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Oe=c(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ke=c(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Ae=c(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),je=c(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Me=c(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Ne=e(P(),1),B=e(R(),1),V=k(),Pe=Object.defineProperty,Fe=(e,t)=>Pe(e,`name`,{value:t,configurable:!0}),Ie=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Le=B.forwardRef(Fe(function(e,t){return(0,V.jsx)(T.span,{...e,ref:t,style:{...Ie,...e.style}})},`VisuallyHidden`)),Re=Object.defineProperty,H=(e,t)=>Re(e,`name`,{value:t,configurable:!0}),ze=`Checkbox`,[Be,Ve]=E(ze),[He,Ue]=Be(ze);function We(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=x({prop:n,defaultProp:i??!1,onChange:c,caller:ze}),[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useRef(!1),[y,b]=B.useReducer(e=>e+1,0),S=!m||!!o||!!m.closest(`form`),C={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:!U(i)&&i,isFormControl:S,bubbleInput:g,setBubbleInput:_};return(0,V.jsx)(He,{scope:t,...C,children:Qe(d)?d(C):r})}H(We,`CheckboxProvider`);var Ge=`CheckboxTrigger`,Ke=B.forwardRef(H(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=Ue(Ge,e),g=_(i,u),v=B.useRef(c);return B.useEffect(()=>{let e=a?.form;if(e){let t=H(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,V.jsx)(T.button,{type:`button`,role:`checkbox`,"aria-checked":U(c)?`mixed`:c,"aria-required":l,"data-state":$e(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:F(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:F(n,e=>{p(),d(e=>U(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),qe=B.forwardRef(H(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,V.jsx)(We,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ke,{...d,ref:t,__scopeCheckbox:n}),e&&(0,V.jsx)(Ze,{__scopeCheckbox:n})]})})},`Checkbox`)),Je=`CheckboxIndicator`,Ye=B.forwardRef(H(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Ue(Je,n);return(0,V.jsx)(se,{present:r||U(a.checked)||a.checked===!0,children:(0,V.jsx)(T.span,{"data-state":$e(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Xe=`CheckboxBubbleInput`,Ze=B.forwardRef(H(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:o,userInteractionCount:s,checked:c,defaultChecked:l,required:u,disabled:d,name:f,value:p,form:m,bubbleInput:h,setBubbleInput:g}=Ue(Xe,e),v=_(r,g),y=a(i),b=B.useRef(!1),x=B.useRef(c),S=B.useRef(s);B.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=s!==S.current;S.current=s;let i=x.current!==c;x.current=c;let a=!(r&&o.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});e.indeterminate=U(c),n.call(e,!U(c)&&c),e.dispatchEvent(t),b.current=!1}},[h,c,o,s]);let C=B.useRef(!U(c)&&c);return(0,V.jsx)(T.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:l??C.current,required:u,disabled:d,name:f,value:p,form:m,...n,tabIndex:-1,ref:v,onClick:F(t,e=>{b.current&&e.stopPropagation()}),style:{...n.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Qe(e){return typeof e==`function`}H(Qe,`isFunction`);function U(e){return e===`indeterminate`}H(U,`isIndeterminate`);function $e(e){return U(e)?`indeterminate`:e?`checked`:`unchecked`}H($e,`getState`);var et=Object.defineProperty,tt=(e,t)=>et(e,`name`,{value:t,configurable:!0});function nt(e){let t=B.useRef({value:e,previous:e});return B.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}tt(nt,`usePrevious`);var rt=Object.defineProperty,it=(e,t)=>rt(e,`name`,{value:t,configurable:!0});function at(e,[t,n]){return Math.min(n,Math.max(t,e))}it(at,`clamp`);var ot=Object.defineProperty,W=(e,t)=>ot(e,`name`,{value:t,configurable:!0}),st=`Popover`,[ct,lt]=E(st,[C]),ut=C(),[dt,G]=ct(st),ft=W(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=ut(t),c=B.useRef(null),[l,u]=B.useState(!1),[d,f]=B.useState(0),[p,m]=B.useState(0),[h,g]=x({prop:r,defaultProp:i??!1,onChange:a,caller:st});return(0,V.jsx)(v,{...s,children:(0,V.jsx)(dt,{scope:t,contentId:j(),titleId:j(),descriptionId:j(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:B.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:B.useCallback(()=>u(!0),[]),onCustomAnchorRemove:B.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),pt=`PopoverAnchor`,mt=B.forwardRef(W(function(e,t){let{__scopePopover:n,...r}=e,i=G(pt,n),a=ut(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return B.useEffect(()=>(o(),()=>s()),[o,s]),(0,V.jsx)(A,{...a,...r,ref:t})},`PopoverAnchor`)),ht=`PopoverTrigger`,gt=B.forwardRef(W(function(e,t){let{__scopePopover:n,...r}=e,i=G(ht,n),a=ut(n),o=_(t,i.triggerRef),s=(0,V.jsx)(T.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Ot(i.open),...r,ref:o,onClick:F(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,V.jsx)(A,{asChild:!0,...a,children:s})},`PopoverTrigger`)),_t=`PopoverPortal`,[vt,yt]=ct(_t,{forceMount:void 0}),bt=W(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=G(_t,t);return(0,V.jsx)(vt,{scope:t,forceMount:n,children:(0,V.jsx)(se,{present:n||a.open,children:(0,V.jsx)(ae,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),xt=`PopoverContent`,St=B.forwardRef(W(function(e,t){let n=yt(xt,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=G(xt,e.__scopePopover);return(0,V.jsx)(se,{present:r||a.open,children:a.modal?(0,V.jsx)(wt,{...i,ref:t}):(0,V.jsx)(Tt,{...i,ref:t})})},`PopoverContent`)),Ct=ce(`PopoverContent.RemoveScroll`),wt=B.forwardRef(W(function(e,n){let r=G(xt,e.__scopePopover),i=B.useRef(null),a=_(n,i),o=B.useRef(!1),{nodes:s,registry:c}=g();return B.useEffect(()=>{let e=i.current;if(e)return l(e)},[]),(0,V.jsx)(t,{as:Ct,allowPinchZoom:!0,shards:B.useMemo(()=>[i,...s.map(e=>({current:e}))],[i,s]),children:(0,V.jsx)(Et,{...e,ref:a,branchNodes:s,branchRegistry:c,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:F(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:F(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:F(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Tt=B.forwardRef(W(function(e,t){let n=G(xt,e.__scopePopover),r=B.useRef(!1),i=B.useRef(!1);return(0,V.jsx)(Et,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Et=B.forwardRef(W(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:f,branchRegistry:p,...m}=e,h=G(xt,n),g=ut(n),[v,y]=B.useState(null),x=_(t,y);return D(v),S(),(0,V.jsx)(z,{registry:p,children:(0,V.jsx)(te,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,V.jsx)(ne,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,V.jsx)(b,{"data-state":Ot(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?kt(d,h.descriptionId):d,...g,...m,ref:x,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`)),Dt=B.forwardRef(W(function(e,t){let{__scopePopover:n,...r}=e,i=ut(n);return(0,V.jsx)(oe,{...i,...r,ref:t})},`PopoverArrow`));function Ot(e){return e?`open`:`closed`}W(Ot,`getState`);function kt(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}W(kt,`concatAriaDescribedby`);var At=Object.defineProperty,K=(e,t)=>At(e,`name`,{value:t,configurable:!0}),jt=`Progress`,Mt=100,[Nt,Pt]=E(jt),[Ft,It]=Nt(jt),Lt=B.forwardRef(K(function(e,t){let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=Bt,...o}=e;(i||i===0)&&!Ut(i)&&console.error(Gt(`${i}`,`Progress`));let s=Ut(i)?i:Mt;r!==null&&!Wt(r,s)&&console.error(Kt(`${r}`,`Progress`));let c=Wt(r,s)?r:null,l=Ht(c)?a(c,s):void 0;return(0,V.jsx)(Ft,{scope:n,value:c,max:s,children:(0,V.jsx)(T.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Ht(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":Vt(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})},`Progress`)),Rt=`ProgressIndicator`,zt=B.forwardRef(K(function(e,t){let{__scopeProgress:n,...r}=e,i=It(Rt,n);return(0,V.jsx)(T.div,{"data-state":Vt(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})},`ProgressIndicator`));function Bt(e,t){return`${Math.round(e/t*100)}%`}K(Bt,`defaultGetValueLabel`);function Vt(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}K(Vt,`getProgressState`);function Ht(e){return typeof e==`number`}K(Ht,`isNumber`);function Ut(e){return Ht(e)&&!isNaN(e)&&e>0}K(Ut,`isValidMaxNumber`);function Wt(e,t){return Ht(e)&&!isNaN(e)&&e<=t&&e>=0}K(Wt,`isValidValueNumber`);function Gt(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Mt}\`.`}K(Gt,`getInvalidMaxError`);function Kt(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
2
|
-
- a positive number
|
|
3
|
-
- less than the value passed to \`max\` (or ${Mt} if no \`max\` prop is set)
|
|
4
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
5
|
-
|
|
6
|
-
Defaulting to \`null\`.`}K(Kt,`getInvalidValueError`);var qt=Object.defineProperty,q=(e,t)=>qt(e,`name`,{value:t,configurable:!0}),Jt={ItemAligned:`item-aligned`,Popper:`popper`},Yt={LTR:`ltr`,RTL:`rtl`},Xt=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Zt=[` `,`Enter`],Qt=`Select`,[$t,en,tn]=M(Qt),[J,nn]=E(Qt,[tn,C]),rn=C(),[an,Y]=J(Qt),[on,sn]=J(Qt);function cn(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=rn(t),[_,b]=B.useState(null),[S,C]=B.useState(null),[w,T]=B.useState(!1),E=y(l),[ee,D]=x({prop:r,defaultProp:i??!1,onChange:a,caller:Qt}),[O,k]=x({prop:o,defaultProp:s,onChange:c,caller:Qt}),A=B.useRef(null),M=B.useRef(O);B.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=q(()=>k(M.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,k]);let N=!_||!!m||!!_.closest(`form`),[P,te]=B.useState(new Set),ne=j(),F=Array.from(P).map(e=>e.props.value).join(`;`),I=B.useCallback(e=>{te(t=>new Set(t).add(e))},[]),L=B.useCallback(e=>{te(t=>{let n=new Set(t);return n.delete(e),n})},[]),R={required:p,trigger:_,onTriggerChange:b,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:ne,value:O,onValueChange:k,open:ee,onOpenChange:D,dir:E,triggerPointerDownPosRef:A,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:P,nativeSelectKey:F,isFormControl:N};return(0,V.jsx)(v,{...g,children:(0,V.jsx)(an,{scope:t,...R,children:(0,V.jsx)($t.Provider,{scope:t,children:(0,V.jsx)(on,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:L,children:qn(h)?h(R):n})})})})}q(cn,`SelectProvider`);var ln=q(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,V.jsx)(cn,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,V.jsxs)(V.Fragment,{children:[n,e?(0,V.jsx)(Kn,{__scopeSelect:t}):null]})})},`Select`),un=`SelectTrigger`,dn=B.forwardRef(q(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=rn(n),o=Y(un,n),s=o.disabled||r,c=_(t,o.onTriggerChange),l=en(n),u=B.useRef(`touch`),[d,f,p]=Yn(e=>{let t=l().filter(e=>!e.disabled),n=Xn(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=q(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,V.jsx)(A,{asChild:!0,...a,children:(0,V.jsx)(T.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Jn(o.value)?``:void 0,...i,ref:c,onClick:F(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:F(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:F(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Xt.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),fn=`SelectValue`,pn=B.forwardRef(q(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Y(fn,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=_(t,c.onValueNodeChange);w(()=>{l(u)},[l,u]);let f=Jn(c.value);return(0,V.jsx)(T.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,V.jsx)(B.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),mn=B.forwardRef(q(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,V.jsx)(T.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[hn,gn]=J(`SelectPortal`,{forceMount:void 0}),_n=q(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,V.jsx)(hn,{scope:e.__scopeSelect,forceMount:n,children:(0,V.jsx)(ae,{asChild:!0,...r})})},`SelectPortal`),X=`SelectContent`,vn=B.forwardRef(q(function(e,t){let n=gn(X,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Y(X,e.__scopeSelect),[o,s]=B.useState();return w(()=>{s(new DocumentFragment)},[]),(0,V.jsx)(se,{present:r||a.open,children:({present:e})=>e?(0,V.jsx)(Sn,{...i,ref:t}):(0,V.jsx)(yn,{...i,fragment:o})})},`SelectContent`)),yn=B.forwardRef(q(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Ne.createPortal((0,V.jsx)(bn,{scope:n,children:(0,V.jsx)($t.Slot,{scope:n,children:(0,V.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Z=10,[bn,Q]=J(X),xn=ce(`SelectContent.RemoveScroll`),Sn=B.forwardRef(q(function(e,n){let{__scopeSelect:r}=e,{position:i=Jt.ItemAligned,onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:y,...b}=e,x=Y(X,r),[C,w]=B.useState(null),[T,E]=B.useState(null),ee=_(n,w),[D,O]=B.useState(null),[k,A]=B.useState(null),j=en(r),[M,N]=B.useState(!1),P=B.useRef(!1);B.useEffect(()=>{if(C)return l(C)},[C]),S();let I=B.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&T&&(T.scrollTop=0),n===r&&T&&(T.scrollTop=T.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,T]),L=B.useCallback(()=>I([D,C]),[I,D,C]);B.useEffect(()=>{M&&L()},[M,L]);let{onOpenChange:R,triggerPointerDownPosRef:z}=x;B.useEffect(()=>{if(C){let e={x:0,y:0},t=q(t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},`handlePointerMove`),n=q(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(C)||R(!1),document.removeEventListener(`pointermove`,t),z.current=null},`handlePointerUp`);return z.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[C,R,z]),B.useEffect(()=>{let e=q(()=>R(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[R]);let[re,ie]=Yn(e=>{let t=j().filter(e=>!e.disabled),n=Xn(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=B.useCallback((e,t,n)=>{let r=!P.current&&!n;(x.value!==void 0&&x.value===t||r)&&(O(e),r&&(P.current=!0))},[x.value]),oe=B.useCallback(()=>C?.focus(),[C]),se=B.useCallback((e,t,n)=>{let r=!P.current&&!n;(x.value!==void 0&&x.value===t||r)&&A(e)},[x.value]),ce=i===Jt.Popper?wn:Cn,le=ce===wn?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return(0,V.jsx)(bn,{scope:r,content:C,viewport:T,onViewportChange:E,itemRefCallback:ae,selectedItem:D,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:L,selectedItemText:k,position:i,isPositioned:M,searchRef:re,children:(0,V.jsx)(t,{as:xn,allowPinchZoom:!0,children:(0,V.jsx)(te,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:F(a,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,V.jsx)(ne,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:(0,V.jsx)(ce,{role:`listbox`,id:x.contentId,"data-state":x.open?`open`:`closed`,dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...le,onPlaced:()=>N(!0),ref:ee,style:{display:`flex`,flexDirection:`column`,outline:`none`,...b.style},onKeyDown:F(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>I(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Cn=B.forwardRef(q(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Y(X,n),o=Q(X,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=_(t,u),f=en(n),p=B.useRef(!1),m=B.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=o,b=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==Yt.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Z,d=at(a,[Z,Math.max(Z,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Z,d=at(a,[Z,Math.max(Z,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Z*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),_=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+_+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Z,ee=c-E,D=g.offsetHeight/2,O=g.offsetTop+D,k=m+_+O,A=x-k;if(k<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=k+Math.max(ee,D+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+D)+A;s.style.height=t+`px`,h.scrollTop=k-E+h.offsetTop}s.style.margin=`${Z}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,v,a.dir,r]);w(()=>b(),[b]);let[x,S]=B.useState();w(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);let C=B.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]);return(0,V.jsx)(Tn,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,V.jsx)(T.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),wn=B.forwardRef(q(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Z,...a}=e,o=rn(n);return(0,V.jsx)(b,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Tn,En]=J(X,{}),Dn=`SelectViewport`,On=B.forwardRef(q(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Q(Dn,n),o=En(Dn,n),s=_(t,a.onViewportChange),c=B.useRef(0);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,V.jsx)($t.Slot,{scope:n,children:(0,V.jsx)(T.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:F(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Z*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[kn,An]=J(`SelectGroup`),jn=`SelectItem`,[Mn,Nn]=J(jn),Pn=B.forwardRef(q(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Y(jn,n),c=Q(jn,n),l=s.value===r,[u,d]=B.useState(a??``),[f,p]=B.useState(!1),m=ie(e=>c.itemRefCallback?.(e,r,i)),h=_(t,m),g=j(),v=B.useRef(`touch`),y=q(()=>{s.onValueChange(r),s.onOpenChange(!1)},`handleSelect`);return(0,V.jsx)(Mn,{scope:n,value:r,disabled:i,textId:g,isSelected:l,onItemTextChange:B.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,V.jsx)($t.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,V.jsx)(T.div,{role:`option`,"aria-labelledby":g,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:h,onFocus:F(o.onFocus,()=>p(!0)),onBlur:F(o.onBlur,()=>p(!1)),onClick:F(o.onClick,()=>{i||v.current!==`mouse`&&y()}),onPointerUp:F(o.onPointerUp,()=>{i||v.current===`mouse`&&y()}),onPointerDown:F(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:F(o.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:F(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:F(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Zt.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Fn=`SelectItemText`,In=B.forwardRef(q(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=Y(Fn,n),s=Q(Fn,n),c=Nn(Fn,n),l=sn(Fn,n),[u,d]=B.useState(null),f=ie(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=_(t,d,c.onItemTextChange,f),m=u?.textContent,h=B.useMemo(()=>(0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=l;return w(()=>(g(h),()=>v(h)),[g,v,h]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(T.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Jn(o.value)?Ne.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Ln=`SelectItemIndicator`,Rn=B.forwardRef(q(function(e,t){let{__scopeSelect:n,...r}=e;return Nn(Ln,n).isSelected?(0,V.jsx)(T.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),zn=`SelectScrollUpButton`,Bn=B.forwardRef(q(function(e,t){let n=Q(zn,e.__scopeSelect),r=En(zn,e.__scopeSelect),[i,a]=B.useState(!1),o=_(t,r.onScrollButtonChange);return w(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)(Un,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Vn=`SelectScrollDownButton`,Hn=B.forwardRef(q(function(e,t){let n=Q(Vn,e.__scopeSelect),r=En(Vn,e.__scopeSelect),[i,a]=B.useState(!1),o=_(t,r.onScrollButtonChange);return w(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)(Un,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Un=B.forwardRef(q(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Q(`SelectScrollButton`,n),o=B.useRef(null),s=en(n),c=B.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return B.useEffect(()=>()=>c(),[c]),w(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,V.jsx)(T.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:F(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:F(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:F(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Wn=B.forwardRef(q(function(e,t){let{__scopeSelect:n,...r}=e;return(0,V.jsx)(T.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),Gn=`SelectBubbleInput`,Kn=B.forwardRef(q(function({__scopeSelect:e,...t},n){let r=Y(Gn,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=B.useRef(null),m=_(n,p),h=i??``,g=nt(h),v=Array.from(d).some(e=>(e.props.value??``)===``);return B.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,V.jsxs)(T.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Ie,...t.style},ref:m,defaultValue:h,children:[Jn(i)&&!v?(0,V.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function qn(e){return typeof e==`function`}q(qn,`isFunction`);function Jn(e){return e===``||e===void 0}q(Jn,`shouldShowPlaceholder`);function Yn(e){let t=ie(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i),q((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}q(Yn,`useTypeaheadSearch`);function Xn(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Zn(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}q(Xn,`findNextItem`);function Zn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}q(Zn,`wrapArray`);function Qn({...e}){return(0,V.jsx)(ln,{"data-slot":`select`,...e})}function $n({...e}){return(0,V.jsx)(pn,{"data-slot":`select-value`,...e})}function er({className:e,size:t=`default`,children:r,...i}){return(0,V.jsxs)(dn,{"data-slot":`select-trigger`,"data-size":t,className:n(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...i,children:[r,(0,V.jsx)(mn,{asChild:!0,children:(0,V.jsx)(Ee,{className:`size-4 opacity-50`})})]})}function tr({className:e,children:t,position:r=`item-aligned`,align:i=`center`,...a}){return(0,V.jsx)(_n,{children:(0,V.jsxs)(vn,{"data-slot":`select-content`,className:n(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,r===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:r,align:i,...a,children:[(0,V.jsx)(ir,{}),(0,V.jsx)(On,{className:n(`p-1`,r===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,V.jsx)(ar,{})]})})}function nr({className:e,children:t,...r}){return(0,V.jsxs)(Pn,{"data-slot":`select-item`,className:n(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...r,children:[(0,V.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,V.jsx)(Rn,{children:(0,V.jsx)(Te,{className:`size-4`})})}),(0,V.jsx)(In,{children:t})]})}function rr({className:e,...t}){return(0,V.jsx)(Wn,{"data-slot":`select-separator`,className:n(`pointer-events-none -mx-1 my-1 h-px bg-border`,e),...t})}function ir({className:e,...t}){return(0,V.jsx)(Bn,{"data-slot":`select-scroll-up-button`,className:n(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,V.jsx)(Oe,{className:`size-4`})})}function ar({className:e,...t}){return(0,V.jsx)(Hn,{"data-slot":`select-scroll-down-button`,className:n(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,V.jsx)(Ee,{className:`size-4`})})}function $({className:e,icon:t=!1,...r}){return(0,V.jsx)(re,{variant:`ghost`,size:t?`icon-sm`:`sm`,"data-bar":``,className:n(`font-normal text-lead hover:bg-stone-2 hover:text-ink aria-expanded:bg-stone-2 aria-expanded:text-ink aria-pressed:bg-here aria-pressed:text-ink`,t?`size-7 [&_svg:not([class*='size-'])]:size-4`:`h-7.5 gap-1.5 px-2 [&_svg:not([class*='size-'])]:size-3.5`,e),...r})}function or({className:e,...t}){return(0,V.jsx)(er,{size:`sm`,"data-bar":``,className:n(`gap-1.5 px-2 font-normal text-lead shadow-none data-[size=sm]:h-7.5 hover:text-ink data-[state=open]:text-ink [&_svg:not([class*='size-'])]:size-3.5`,e),...t})}var sr=16,cr=8;function lr(){return(0,V.jsx)(Dt,{asChild:!0,width:sr,height:cr,children:(0,V.jsxs)(`svg`,{viewBox:`0 0 ${String(sr)} ${String(cr)}`,"aria-hidden":!0,className:`-mt-px block overflow-visible`,children:[(0,V.jsx)(`path`,{d:`M0 -1 L${String(sr/2)} 7 L${String(sr)} -1 Z`,className:`fill-popover`}),(0,V.jsx)(`path`,{d:`M0 0 L${String(sr/2)} 7 L${String(sr)} 0`,className:`fill-none stroke-border`})]})})}function ur({className:e,...t}){return(0,V.jsx)(qe,{"data-slot":`checkbox`,className:n(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary`,e),...t,children:(0,V.jsx)(Ye,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,V.jsx)(Te,{className:`size-3.5`})})})}function dr({...e}){return(0,V.jsx)(ft,{"data-slot":`popover`,...e})}function fr({...e}){return(0,V.jsx)(gt,{"data-slot":`popover-trigger`,...e})}function pr({className:e,align:t=`center`,sideOffset:r=4,...i}){return(0,V.jsx)(bt,{children:(0,V.jsx)(St,{"data-slot":`popover-content`,align:t,sideOffset:r,className:n(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...i})})}function mr({...e}){return(0,V.jsx)(mt,{"data-slot":`popover-anchor`,...e})}function hr({className:e,value:t,...r}){return(0,V.jsx)(Lt,{"data-slot":`progress`,className:n(`relative h-2 w-full overflow-hidden rounded-full bg-primary/20`,e),...r,children:(0,V.jsx)(zt,{"data-slot":`progress-indicator`,className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})})}function gr({...e}){return(0,V.jsx)(s,{"data-slot":`sheet`,...e})}function _r({...e}){return(0,V.jsx)(f,{"data-slot":`sheet-portal`,...e})}function vr({className:e,...t}){return(0,V.jsx)(m,{"data-slot":`sheet-overlay`,className:n(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function yr({className:e,children:t,side:r=`right`,showCloseButton:a=!0,...s}){return(0,V.jsxs)(_r,{children:[(0,V.jsx)(vr,{}),(0,V.jsxs)(o,{"data-slot":`sheet-content`,className:n(`fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,r===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,r===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,r===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,r===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...s,children:[t,a&&(0,V.jsxs)(I,{className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,V.jsx)(i,{className:`size-4`}),(0,V.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function br({className:e,...t}){return(0,V.jsx)(h,{"data-slot":`sheet-title`,className:n(`font-semibold text-foreground`,e),...t})}var xr=5;function Sr(e,t){return e.filter(e=>e.item===t&&e.state!==`cancelled`).reverse().slice(0,xr)}var Cr=e=>e.state===`queued`||e.state===`running`;function wr(e,t,n,r={}){let i=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e));return Cr(e)&&i(e.versions,t)&&i(e.types,n)&&Tr(e.options??{},r)}var Tr=(e,t)=>Object.keys({...e,...t}).every(n=>e[n]===t[n]);function Er(e,t,n){return Object.fromEntries(e.flatMap(e=>{let r=n[e.name];return!e.only.includes(t)||r===void 0?[]:e.values?e.values.includes(String(r))?[[e.name,r]]:[]:r===!0?[[e.name,!0]]:[]}))}function Dr(e,t){return Math.max(0,e.filter(Cr).map(e=>e.id).indexOf(t))}function Or(e,t,n,r){if(n.length!==0)return e===`all`?[...n]:e===`some`?n.filter(e=>r.includes(e)):t===void 0?[...n]:[t]}function kr(e,t){let n=e.findLast(Cr);if(n)return n.state===`running`?{at:`running`,percent:Math.round(n.progress*100)}:{at:`queued`};let r=e[0];return r===void 0||!t.has(r.id)?{at:`idle`}:r.state===`failed`?{at:`failed`}:{at:`done`}}var Ar=e=>e.slice(e.lastIndexOf(`/`)+1),jr=O({en:{saved:{saved:`Saved`,saving:`Saving…`,unsaved:`Not saved yet`,error:`Not saved`},moreTools:`More`,export:`Export`,exported:`Exported`,exportFailed:`Export failed`,format:`Format`,versions:`Languages`,include:`Include`,onShow:`On show`,all:e=>`All ${String(e)} languages`,choose:`Choose…`,chosen:e=>`${String(e)} chosen`,back:`Back`,checking:`Checking…`,blocked:e=>e===1?`1 must-fix problem stops the export`:`${String(e)} must-fix problems stop the export`,start:`Export`,queued:`Waiting`,queuedAhead:e=>`Waiting, ${String(e)} ahead`,running:e=>`Exporting ${String(e)}%`,cancel:`Cancel`,retry:`Try again`,failedHelp:e=>`Try again, or ask ${e} what went wrong.`,partial:`Some files could not be made.`,startFailed:`The export did not start`,nVersions:e=>`${String(e)} versions`,show:`Show in folder`,download:`Download`,option:{pptx:{label:`Slides`,values:{native:`Editable`,editable:`Pictures with text boxes`,picture:`Pictures`}},steps:{label:`Each animation step`}},type:{mov:`MOV (ProRes)`,srt:`Captions`,cover:`Cover image`,pngPages:`PNG pages`,pptx:`PowerPoint`}},"zh-cn":{saved:{saved:`已保存`,saving:`正在保存…`,unsaved:`尚未保存`,error:`没能保存`},moreTools:`更多`,export:`导出`,exported:`已导出`,exportFailed:`导出失败`,format:`格式`,versions:`语言`,include:`附带`,onShow:`当前`,all:e=>`全部 ${String(e)} 种语言`,choose:`选择…`,chosen:e=>`已选 ${String(e)} 个`,back:`返回`,checking:`检查中…`,blocked:e=>`有 ${String(e)} 个必修问题,暂时不能导出`,start:`导出`,queued:`排队中`,queuedAhead:e=>`排队中,前面还有 ${String(e)} 个`,running:e=>`导出中 ${String(e)}%`,cancel:`取消`,retry:`重试`,failedHelp:e=>`请重试,或让 ${e} 看看哪里出了问题。`,partial:`部分文件没能生成。`,startFailed:`导出没有开始`,nVersions:e=>`${String(e)} 个版本`,show:`在文件夹中显示`,download:`下载`,option:{pptx:{label:`幻灯片`,values:{native:`可编辑`,editable:`图片加文本框`,picture:`图片`}},steps:{label:`每个动画步骤`}},type:{mov:`MOV(ProRes)`,srt:`字幕`,cover:`封面图`,pngPages:`PNG 页面`,pptx:`PowerPoint`}},"zh-tw":{saved:{saved:`已儲存`,saving:`正在儲存…`,unsaved:`尚未儲存`,error:`沒能儲存`},moreTools:`更多`,export:`匯出`,exported:`已匯出`,exportFailed:`匯出失敗`,format:`格式`,versions:`語言`,include:`附帶`,onShow:`目前`,all:e=>`全部 ${String(e)} 種語言`,choose:`選擇…`,chosen:e=>`已選 ${String(e)} 個`,back:`返回`,checking:`檢查中…`,blocked:e=>`有 ${String(e)} 個必須修正的問題,暫時無法匯出`,start:`匯出`,queued:`排隊中`,queuedAhead:e=>`排隊中,前面還有 ${String(e)} 個`,running:e=>`匯出中 ${String(e)}%`,cancel:`取消`,retry:`重試`,failedHelp:e=>`請重試,或讓 ${e} 看看哪裡出了問題。`,partial:`部分檔案沒能產生。`,startFailed:`匯出沒有開始`,nVersions:e=>`${String(e)} 個版本`,show:`在資料夾中顯示`,download:`下載`,option:{pptx:{label:`投影片`,values:{native:`可編輯`,editable:`圖片加文字方塊`,picture:`圖片`}},steps:{label:`每個動畫步驟`}},type:{mov:`MOV(ProRes)`,srt:`字幕`,cover:`封面圖`,pngPages:`PNG 頁面`,pptx:`PowerPoint`}},ja:{saved:{saved:`保存済み`,saving:`保存中…`,unsaved:`未保存`,error:`保存できませんでした`},moreTools:`その他`,export:`書き出し`,exported:`書き出し済み`,exportFailed:`書き出しに失敗`,format:`形式`,versions:`言語`,include:`追加`,onShow:`表示中`,all:e=>`全 ${String(e)} 言語`,choose:`選択…`,chosen:e=>`${String(e)} 件選択`,back:`戻る`,checking:`チェック中…`,blocked:e=>`要修正の問題が ${String(e)} 件あるため書き出せません`,start:`書き出す`,queued:`待機中`,queuedAhead:e=>`待機中、前に ${String(e)} 件`,running:e=>`書き出し中 ${String(e)}%`,cancel:`キャンセル`,retry:`再試行`,failedHelp:e=>`もう一度試すか、${e} に原因を確認してください。`,partial:`一部のファイルを作成できませんでした。`,startFailed:`書き出しを開始できませんでした`,nVersions:e=>`${String(e)} 個のバージョン`,show:`フォルダに表示`,download:`ダウンロード`,option:{pptx:{label:`スライド`,values:{native:`編集可能`,editable:`画像とテキスト ボックス`,picture:`画像`}},steps:{label:`アニメーションの各ステップ`}},type:{mov:`MOV(ProRes)`,srt:`字幕`,cover:`カバー画像`,pngPages:`PNG ページ`,pptx:`PowerPoint`}},ko:{saved:{saved:`저장됨`,saving:`저장 중…`,unsaved:`아직 저장되지 않음`,error:`저장되지 않음`},moreTools:`더보기`,export:`내보내기`,exported:`내보냄`,exportFailed:`내보내기 실패`,format:`형식`,versions:`언어`,include:`포함`,onShow:`현재`,all:e=>`${String(e)}개 언어 모두`,choose:`선택…`,chosen:e=>`${String(e)}개 선택`,back:`뒤로`,checking:`확인 중…`,blocked:e=>`수정이 필요한 문제 ${String(e)}개 때문에 내보낼 수 없습니다`,start:`내보내기`,queued:`대기 중`,queuedAhead:e=>`대기 중, 앞에 ${String(e)}개`,running:e=>`내보내는 중 ${String(e)}%`,cancel:`취소`,retry:`다시 시도`,failedHelp:e=>`다시 시도하거나 ${e}에게 원인을 물어보세요.`,partial:`일부 파일을 만들지 못했습니다.`,startFailed:`내보내기를 시작하지 못했습니다`,nVersions:e=>`버전 ${String(e)}개`,show:`폴더에서 보기`,download:`다운로드`,option:{pptx:{label:`슬라이드`,values:{native:`편집 가능`,editable:`이미지와 텍스트 상자`,picture:`이미지`}},steps:{label:`애니메이션 단계별로`}},type:{mov:`MOV (ProRes)`,srt:`자막`,cover:`표지 이미지`,pngPages:`PNG 페이지`,pptx:`PowerPoint`}},es:{saved:{saved:`Guardado`,saving:`Guardando…`,unsaved:`Aún sin guardar`,error:`No guardado`},moreTools:`Más`,export:`Exportar`,exported:`Exportado`,exportFailed:`Error al exportar`,format:`Formato`,versions:`Idiomas`,include:`Incluir`,onShow:`Actual`,all:e=>`Los ${String(e)} idiomas`,choose:`Elegir…`,chosen:e=>`${String(e)} elegidos`,back:`Atrás`,checking:`Comprobando…`,blocked:e=>`${String(e)} problemas obligatorios detienen la exportación`,start:`Exportar`,queued:`En espera`,queuedAhead:e=>`En espera, ${String(e)} delante`,running:e=>`Exportando ${String(e)} %`,cancel:`Cancelar`,retry:`Reintentar`,failedHelp:e=>`Reinténtalo o pregunta a ${e} qué ha fallado.`,partial:`No se pudieron crear algunos archivos.`,startFailed:`La exportación no empezó`,nVersions:e=>`${String(e)} versiones`,show:`Mostrar en la carpeta`,download:`Descargar`,option:{pptx:{label:`Diapositivas`,values:{native:`Editables`,editable:`Imágenes con cuadros de texto`,picture:`Imágenes`}},steps:{label:`Cada paso de animación`}},type:{mov:`MOV (ProRes)`,srt:`Subtítulos`,cover:`Imagen de portada`,pngPages:`Páginas PNG`,pptx:`PowerPoint`}},fr:{saved:{saved:`Enregistré`,saving:`Enregistrement…`,unsaved:`Pas encore enregistré`,error:`Non enregistré`},moreTools:`Plus`,export:`Exporter`,exported:`Exporté`,exportFailed:`Échec de l’export`,format:`Format`,versions:`Langues`,include:`Inclure`,onShow:`Affichée`,all:e=>`Les ${String(e)} langues`,choose:`Choisir…`,chosen:e=>`${String(e)} choisies`,back:`Retour`,checking:`Vérification…`,blocked:e=>`${String(e)} problèmes à corriger bloquent l’export`,start:`Exporter`,queued:`En attente`,queuedAhead:e=>`En attente, ${String(e)} avant celui-ci`,running:e=>`Export ${String(e)}\u00a0%`,cancel:`Annuler`,retry:`Réessayer`,failedHelp:e=>`Réessayez ou demandez à ${e} ce qui n’a pas marché.`,partial:`Certains fichiers n’ont pas pu être créés.`,startFailed:`L’export n’a pas démarré`,nVersions:e=>`${String(e)} versions`,show:`Afficher dans le dossier`,download:`Télécharger`,option:{pptx:{label:`Diapositives`,values:{native:`Modifiables`,editable:`Images avec zones de texte`,picture:`Images`}},steps:{label:`Chaque étape d'animation`}},type:{mov:`MOV (ProRes)`,srt:`Sous-titres`,cover:`Image de couverture`,pngPages:`Pages PNG`,pptx:`PowerPoint`}},de:{saved:{saved:`Gespeichert`,saving:`Wird gespeichert…`,unsaved:`Noch nicht gespeichert`,error:`Nicht gespeichert`},moreTools:`Mehr`,export:`Exportieren`,exported:`Exportiert`,exportFailed:`Export fehlgeschlagen`,format:`Format`,versions:`Sprachen`,include:`Dazu`,onShow:`Aktuell`,all:e=>`Alle ${String(e)} Sprachen`,choose:`Auswählen…`,chosen:e=>`${String(e)} ausgewählt`,back:`Zurück`,checking:`Wird geprüft…`,blocked:e=>`${String(e)} Probleme verhindern den Export`,start:`Exportieren`,queued:`Wartet`,queuedAhead:e=>`Wartet, ${String(e)} davor`,running:e=>`Export läuft: ${String(e)} %`,cancel:`Abbrechen`,retry:`Erneut versuchen`,failedHelp:e=>`Versuche es erneut oder frage ${e}, was schiefgelaufen ist.`,partial:`Einige Dateien konnten nicht erstellt werden.`,startFailed:`Der Export ist nicht gestartet`,nVersions:e=>`${String(e)} Versionen`,show:`Im Ordner zeigen`,download:`Herunterladen`,option:{pptx:{label:`Folien`,values:{native:`Bearbeitbar`,editable:`Bilder mit Textfeldern`,picture:`Bilder`}},steps:{label:`Jeden Animationsschritt`}},type:{mov:`MOV (ProRes)`,srt:`Untertitel`,cover:`Titelbild`,pngPages:`PNG-Seiten`,pptx:`PowerPoint`}},it:{saved:{saved:`Salvato`,saving:`Salvataggio…`,unsaved:`Non ancora salvato`,error:`Non salvato`},moreTools:`Altro`,export:`Esporta`,exported:`Esportato`,exportFailed:`Esportazione non riuscita`,format:`Formato`,versions:`Lingue`,include:`Includi`,onShow:`Attuale`,all:e=>`Tutte le ${String(e)} lingue`,choose:`Scegli…`,chosen:e=>`${String(e)} scelte`,back:`Indietro`,checking:`Controllo…`,blocked:e=>`${String(e)} problemi da correggere bloccano l’esportazione`,start:`Esporta`,queued:`In attesa`,queuedAhead:e=>`In attesa, ${String(e)} prima`,running:e=>`Esportazione ${String(e)}%`,cancel:`Annulla`,retry:`Riprova`,failedHelp:e=>`Riprova o chiedi a ${e} cosa è andato storto.`,partial:`Non è stato possibile creare alcuni file.`,startFailed:`L'esportazione non è partita`,nVersions:e=>`${String(e)} versioni`,show:`Mostra nella cartella`,download:`Scarica`,option:{pptx:{label:`Diapositive`,values:{native:`Modificabili`,editable:`Immagini con caselle di testo`,picture:`Immagini`}},steps:{label:`Ogni passaggio dell'animazione`}},type:{mov:`MOV (ProRes)`,srt:`Sottotitoli`,cover:`Immagine di copertina`,pngPages:`Pagine PNG`,pptx:`PowerPoint`}},pt:{saved:{saved:`Salvo`,saving:`Salvando…`,unsaved:`Ainda não salvo`,error:`Não salvo`},moreTools:`Mais`,export:`Exportar`,exported:`Exportado`,exportFailed:`Falha ao exportar`,format:`Formato`,versions:`Idiomas`,include:`Incluir`,onShow:`Atual`,all:e=>`Todos os ${String(e)} idiomas`,choose:`Escolher…`,chosen:e=>`${String(e)} escolhidos`,back:`Voltar`,checking:`Verificando…`,blocked:e=>`${String(e)} problemas obrigatórios impedem a exportação`,start:`Exportar`,queued:`Aguardando`,queuedAhead:e=>`Aguardando, ${String(e)} na frente`,running:e=>`Exportando ${String(e)}%`,cancel:`Cancelar`,retry:`Tentar novamente`,failedHelp:e=>`Tente novamente ou pergunte a ${e} o que deu errado.`,partial:`Não foi possível criar alguns arquivos.`,startFailed:`A exportação não começou`,nVersions:e=>`${String(e)} versões`,show:`Mostrar na pasta`,download:`Baixar`,option:{pptx:{label:`Slides`,values:{native:`Editáveis`,editable:`Imagens com caixas de texto`,picture:`Imagens`}},steps:{label:`Cada etapa da animação`}},type:{mov:`MOV (ProRes)`,srt:`Legendas`,cover:`Imagem de capa`,pngPages:`Páginas PNG`,pptx:`PowerPoint`}},ru:{saved:{saved:`Сохранено`,saving:`Сохранение…`,unsaved:`Ещё не сохранено`,error:`Не сохранено`},moreTools:`Ещё`,export:`Экспорт`,exported:`Экспортировано`,exportFailed:`Ошибка экспорта`,format:`Формат`,versions:`Языки`,include:`Добавить`,onShow:`Текущий`,all:e=>`Все языки: ${String(e)}`,choose:`Выбрать…`,chosen:e=>`Выбрано: ${String(e)}`,back:`Назад`,checking:`Проверка…`,blocked:e=>`Экспорт остановлен, обязательных проблем: ${String(e)}`,start:`Экспортировать`,queued:`Ожидание`,queuedAhead:e=>`Ожидание, впереди: ${String(e)}`,running:e=>`Экспорт ${String(e)}%`,cancel:`Отменить`,retry:`Повторить`,failedHelp:e=>`Повторите попытку или спросите ${e}, что пошло не так.`,partial:`Некоторые файлы создать не удалось.`,startFailed:`Экспорт не начался`,nVersions:e=>`Версий: ${String(e)}`,show:`Показать в папке`,download:`Скачать`,option:{pptx:{label:`Слайды`,values:{native:`Редактируемые`,editable:`Картинки с надписями`,picture:`Картинки`}},steps:{label:`Каждый шаг анимации`}},type:{mov:`MOV (ProRes)`,srt:`Субтитры`,cover:`Обложка`,pngPages:`Страницы PNG`,pptx:`PowerPoint`}},tr:{saved:{saved:`Kaydedildi`,saving:`Kaydediliyor…`,unsaved:`Henüz kaydedilmedi`,error:`Kaydedilmedi`},moreTools:`Diğer`,export:`Dışa aktar`,exported:`Dışa aktarıldı`,exportFailed:`Dışa aktarılamadı`,format:`Biçim`,versions:`Diller`,include:`Ekle`,onShow:`Geçerli`,all:e=>`${String(e)} dilin tümü`,choose:`Seç…`,chosen:e=>`${String(e)} seçildi`,back:`Geri`,checking:`Denetleniyor…`,blocked:e=>`Düzeltilmesi gereken ${String(e)} sorun dışa aktarmayı durduruyor`,start:`Dışa aktar`,queued:`Bekliyor`,queuedAhead:e=>`Bekliyor, önünde ${String(e)} iş var`,running:e=>`Dışa aktarılıyor %${String(e)}`,cancel:`İptal`,retry:`Yeniden dene`,failedHelp:e=>`Yeniden deneyin ya da sorunu ${e} ile inceleyin.`,partial:`Bazı dosyalar oluşturulamadı.`,startFailed:`Dışa aktarma başlamadı`,nVersions:e=>`${String(e)} sürüm`,show:`Klasörde göster`,download:`İndir`,option:{pptx:{label:`Slaytlar`,values:{native:`Düzenlenebilir`,editable:`Metin kutulu resimler`,picture:`Resimler`}},steps:{label:`Her animasyon adımı`}},type:{mov:`MOV (ProRes)`,srt:`Altyazı`,cover:`Kapak görseli`,pngPages:`PNG sayfaları`,pptx:`PowerPoint`}},vi:{saved:{saved:`Đã lưu`,saving:`Đang lưu…`,unsaved:`Chưa lưu`,error:`Không lưu được`},moreTools:`Thêm`,export:`Xuất`,exported:`Đã xuất`,exportFailed:`Xuất thất bại`,format:`Định dạng`,versions:`Ngôn ngữ`,include:`Kèm theo`,onShow:`Hiện tại`,all:e=>`Cả ${String(e)} ngôn ngữ`,choose:`Chọn…`,chosen:e=>`Đã chọn ${String(e)}`,back:`Quay lại`,checking:`Đang kiểm tra…`,blocked:e=>`${String(e)} vấn đề cần sửa đang chặn việc xuất`,start:`Xuất`,queued:`Đang chờ`,queuedAhead:e=>`Đang chờ, còn ${String(e)} việc phía trước`,running:e=>`Đang xuất ${String(e)}%`,cancel:`Hủy`,retry:`Thử lại`,failedHelp:e=>`Hãy thử lại hoặc hỏi ${e} xem có vấn đề gì.`,partial:`Không tạo được một số tệp.`,startFailed:`Không bắt đầu xuất được`,nVersions:e=>`${String(e)} phiên bản`,show:`Hiện trong thư mục`,download:`Tải xuống`,option:{pptx:{label:`Trang chiếu`,values:{native:`Có thể chỉnh sửa`,editable:`Ảnh kèm hộp văn bản`,picture:`Ảnh`}},steps:{label:`Từng bước hoạt ảnh`}},type:{mov:`MOV (ProRes)`,srt:`Phụ đề`,cover:`Ảnh bìa`,pngPages:`Các trang PNG`,pptx:`PowerPoint`}},th:{saved:{saved:`บันทึกแล้ว`,saving:`กำลังบันทึก…`,unsaved:`ยังไม่ได้บันทึก`,error:`บันทึกไม่ได้`},moreTools:`เพิ่มเติม`,export:`ส่งออก`,exported:`ส่งออกแล้ว`,exportFailed:`ส่งออกไม่สำเร็จ`,format:`รูปแบบ`,versions:`ภาษา`,include:`รวมด้วย`,onShow:`ปัจจุบัน`,all:e=>`ทั้ง ${String(e)} ภาษา`,choose:`เลือก…`,chosen:e=>`เลือกแล้ว ${String(e)}`,back:`กลับ`,checking:`กำลังตรวจสอบ…`,blocked:e=>`มีปัญหาที่ต้องแก้ ${String(e)} รายการ จึงส่งออกไม่ได้`,start:`ส่งออก`,queued:`กำลังรอ`,queuedAhead:e=>`กำลังรอ มีอีก ${String(e)} งานก่อนหน้า`,running:e=>`กำลังส่งออก ${String(e)}%`,cancel:`ยกเลิก`,retry:`ลองอีกครั้ง`,failedHelp:e=>`ลองอีกครั้ง หรือถาม ${e} ว่าเกิดอะไรขึ้น`,partial:`สร้างบางไฟล์ไม่ได้`,startFailed:`เริ่มส่งออกไม่ได้`,nVersions:e=>`${String(e)} เวอร์ชัน`,show:`แสดงในโฟลเดอร์`,download:`ดาวน์โหลด`,option:{pptx:{label:`สไลด์`,values:{native:`แก้ไขได้`,editable:`รูปภาพพร้อมกล่องข้อความ`,picture:`รูปภาพ`}},steps:{label:`แต่ละขั้นของภาพเคลื่อนไหว`}},type:{mov:`MOV (ProRes)`,srt:`คำบรรยาย`,cover:`ภาพหน้าปก`,pngPages:`หน้า PNG`,pptx:`PowerPoint`}},hi:{saved:{saved:`सहेजा गया`,saving:`सहेजा जा रहा है…`,unsaved:`अभी सहेजा नहीं गया`,error:`सहेजा नहीं गया`},moreTools:`और`,export:`एक्सपोर्ट`,exported:`एक्सपोर्ट हो गया`,exportFailed:`एक्सपोर्ट विफल`,format:`फ़ॉर्मैट`,versions:`भाषाएँ`,include:`साथ में`,onShow:`मौजूदा`,all:e=>`सभी ${String(e)} भाषाएँ`,choose:`चुनें…`,chosen:e=>`${String(e)} चुने गए`,back:`वापस`,checking:`जाँच हो रही है…`,blocked:e=>`${String(e)} ज़रूरी समस्याएँ एक्सपोर्ट रोक रही हैं`,start:`एक्सपोर्ट करें`,queued:`प्रतीक्षा में`,queuedAhead:e=>`प्रतीक्षा में, आगे ${String(e)}`,running:e=>`एक्सपोर्ट हो रहा है ${String(e)}%`,cancel:`रद्द करें`,retry:`फिर कोशिश करें`,failedHelp:e=>`फिर कोशिश करें या ${e} से पूछें कि क्या गड़बड़ हुई।`,partial:`कुछ फ़ाइलें नहीं बन सकीं।`,startFailed:`एक्सपोर्ट शुरू नहीं हुआ`,nVersions:e=>`${String(e)} वर्शन`,show:`फ़ोल्डर में दिखाएँ`,download:`डाउनलोड करें`,option:{pptx:{label:`स्लाइड`,values:{native:`संपादन योग्य`,editable:`टेक्स्ट बॉक्स वाली तस्वीरें`,picture:`तस्वीरें`}},steps:{label:`हर एनिमेशन चरण`}},type:{mov:`MOV (ProRes)`,srt:`कैप्शन`,cover:`कवर इमेज`,pngPages:`PNG पेज`,pptx:`PowerPoint`}}}),Mr={mp4:`MP4`,gif:`GIF`,pdf:`PDF`,docx:`Word`,md:`Markdown`,xlsx:`Excel`,csv:`CSV`,json:`JSON`,glb:`GLB`},Nr=(e,t)=>Mr[t]??(t===`png`?e.type.pngPages:t in e.type?e.type[t]:t);function Pr(){let[e,t]=(0,B.useState)(()=>window.matchMedia(`(max-width: 479px)`).matches);return(0,B.useEffect)(()=>{let e=window.matchMedia(`(max-width: 479px)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}},[]),e}function Fr(e){let t=N(),[n,r]=(0,B.useState)([]),[i,a]=(0,B.useState)(new Set),[o,s]=(0,B.useState)(!1);(0,B.useEffect)(()=>{let e=!0;return u(t,`export/list`,{}).then(t=>{e&&(r(t.jobs),s(t.reveal))},()=>void 0),()=>{e=!1}},[t]),ee(`export/changed`,({job:t})=>{r(e=>{let n=e.findIndex(e=>e.id===t.id);return n<0?[...e,t]:e.map((e,r)=>r===n?t:e)}),!Cr(t)&&!e&&a(e=>new Set(e).add(t.id))});let[c,l]=(0,B.useState)(e);return c!==e&&(l(e),e&&a(new Set)),{all:n,fresh:i,reveals:o}}function Ir(e){let t=N(),n=p[e],r=`item-bar.export.${e}`,[i,a]=(0,B.useState)({type:n?.types[0]??``,extras:[],options:{}});return(0,B.useEffect)(()=>{let e=!0;return t[`storage/get`]({key:r}).then(({value:t})=>{let r=t;if(!e||!n||!r)return;let i=n.types.find(e=>e===r.type);i!==void 0&&a({type:i,extras:n.extras.filter(e=>r.extras?.includes(e)),options:r.options??{}})},()=>void 0),()=>{e=!1}},[t,r,n]),[i,e=>{a(e),t[`storage/set`]({key:r,value:e}).catch(()=>void 0)}]}function Lr({percent:e}){return(0,V.jsx)(`span`,{"aria-hidden":!0,className:`relative size-3.5 flex-none rounded-full`,style:{background:`conic-gradient(currentColor ${String(e)}%, var(--allyhub-rule-strong) 0)`},children:(0,V.jsx)(`span`,{className:`bg-background absolute inset-[3px] rounded-full`})})}async function Rr(e,t){let{url:n}=await e[`files/url`]({path:t}),r=document.createElement(`a`);r.href=n,r.download=Ar(t),r.click()}async function zr(e,t,n){n&&await u(e,`export/reveal`,{path:t}).then(()=>!0,()=>!1)||await Rr(e,t)}function Br({job:e,versions:t,ahead:n,words:a,reveals:o}){let s=N(),c=L()?.agent?.name??`AllyHub`,l=Math.round(e.progress*100),f=o?je:ke,p=o?a.show:a.download,m=e.versions.length===0?void 0:e.versions.length>2?a.nVersions(e.versions.length):e.versions.map(e=>t.find(t=>t.key===e)?.label??e).join(`, `),h=[e.types.map(e=>Nr(a,e)).join(`, `),...t.length>1&&m!==void 0?[m]:[]].join(` · `);return(0,V.jsxs)(`div`,{className:`border-t py-2 pr-2 pl-4`,"data-testid":`export-job`,"data-state":e.state,children:[Cr(e)&&(0,V.jsxs)(`div`,{className:`pr-2`,children:[(0,V.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-dense min-w-0 flex-1 truncate`,children:h}),(0,V.jsx)(`span`,{className:`text-lead text-xs tabular-nums`,children:e.state===`running`?`${String(l)}%`:n>0?a.queuedAhead(n):a.queued}),(0,V.jsx)($,{icon:!0,"aria-label":a.cancel,title:a.cancel,"data-testid":`export-cancel`,onClick:()=>{u(s,`export/cancel`,{job:e.id}).catch(()=>void 0)},children:(0,V.jsx)(i,{"aria-hidden":!0})})]}),(0,V.jsx)(hr,{value:l,className:`mt-1 h-1`})]}),e.state===`failed`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,children:[(0,V.jsx)(r,{className:`text-destructive size-3.5 flex-none`,"aria-hidden":!0}),(0,V.jsxs)(`span`,{className:`text-dense text-destructive min-w-0 flex-1 truncate`,children:[a.exportFailed,` · `,h]}),(0,V.jsx)($,{icon:!0,"aria-label":a.retry,title:a.retry,"data-testid":`export-retry`,onClick:()=>{u(s,`export/start`,{item:e.item,versions:e.versions,types:e.types,...e.options?{options:e.options}:{}}).catch(e=>{d.error(a.startFailed,{description:e instanceof Error?e.message:String(e)})})},children:(0,V.jsx)(Me,{"aria-hidden":!0})})]}),(0,V.jsx)(`p`,{className:`text-lead pr-2 pl-5.5 text-xs`,title:e.error,children:a.failedHelp(c)})]}),e.files.map(e=>(0,V.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,"data-testid":`export-file`,children:[(0,V.jsx)(Te,{className:`text-success size-3.5 flex-none`,"aria-hidden":!0}),(0,V.jsx)(`span`,{className:`text-dense min-w-0 flex-1 truncate`,title:e,children:Ar(e)}),(0,V.jsx)($,{icon:!0,"aria-label":p,title:p,"data-testid":`export-give`,onClick:()=>{zr(s,e,o)},children:(0,V.jsx)(f,{"aria-hidden":!0})})]},e)),e.state===`done`&&e.error!==void 0&&(0,V.jsx)(`p`,{className:`text-lead pr-2 pl-5.5 text-xs`,title:e.error,children:a.partial})]})}function Vr({versions:e,shown:t,picked:n,onPick:r,onBack:i,words:a}){return(0,V.jsxs)(`div`,{"data-testid":`export-choose`,children:[(0,V.jsxs)(`div`,{className:`flex h-11 items-center gap-1 border-b pr-4 pl-2`,children:[(0,V.jsx)($,{icon:!0,"aria-label":a.back,title:a.back,onClick:i,children:(0,V.jsx)(De,{"aria-hidden":!0})}),(0,V.jsx)(`span`,{className:`text-sm font-medium`,children:a.versions}),(0,V.jsxs)(`span`,{className:`text-lead ml-auto text-xs tabular-nums`,children:[n.length,`/`,e.length]})]}),(0,V.jsx)(`ul`,{className:`max-h-64 overflow-y-auto p-2`,children:e.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`label`,{className:`hover:bg-accent flex h-8 items-center gap-2 rounded-md px-2 text-sm`,children:[(0,V.jsx)(ur,{checked:n.includes(e.key),"data-version":e.key,onCheckedChange:t=>{r(t===!0?[...n,e.key]:n.filter(t=>t!==e.key))}}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.key===t&&(0,V.jsx)(`span`,{className:`text-lead text-xs`,children:a.onShow})]})},e.key))})]})}function Hr({kind:e,item:t,props:i,jobs:a,all:o,words:s,reveals:c,startRef:l}){let f=N(),m=p[e],h=i.versions??[],g=h.map(e=>e.key),_=h.find(e=>e.key===i.shown)?.label,v=i.unavailable??{},[y,b]=Ir(e),[x,S]=(0,B.useState)(`shown`),[C,w]=(0,B.useState)(i.shown===void 0?[]:[i.shown]),[T,E]=(0,B.useState)(!1),[ee,D]=(0,B.useState)(!1);if(!m)return null;let O=Or(x,i.shown,g,C),k=O?.length??1,A=[y.type,...y.extras.filter(e=>v[e]===void 0)],j=(m.options??[]).filter(e=>e.only.includes(y.type)),M=Er(j,y.type,y.options),P=j.filter(e=>e.values===void 0),te=(e,t)=>{b({...y,options:{...y.options,[e]:t}})},ne=i.check?.waiting===!0,F=ne?0:i.check?.problems(O)??0,I=a.some(e=>wr(e,O??[],A,M)),L=async()=>{D(!0);try{await u(f,`export/start`,{item:t,...O?{versions:O}:{},types:A,...Object.keys(M).length>0?{options:M}:{}})}catch(e){d.error(s.startFailed,{description:e instanceof Error?e.message:String(e)})}finally{D(!1)}},R=(0,V.jsxs)(Qn,{value:y.type,onValueChange:e=>{b({...y,type:e})},children:[(0,V.jsx)(er,{size:`sm`,"aria-label":s.format,className:`w-full min-w-0`,"data-testid":`export-format`,children:(0,V.jsx)($n,{})}),(0,V.jsx)(tr,{position:`popper`,align:`start`,children:m.types.map(e=>(0,V.jsx)(nr,{value:e,"data-type":e,children:Nr(s,e)},e))})]}),z=(0,V.jsx)(re,{ref:l,size:`sm`,disabled:ne||F>0||ee||k===0||I,"data-testid":`export-start`,onClick:()=>{L()},children:ne?s.checking:s.start}),ie=g.length<=1&&m.extras.length===0&&j.length===0&&m.types.length>1&&i.facts===void 0&&F===0;return(0,V.jsxs)(`div`,{className:`overflow-hidden rounded-lg text-sm`,"data-testid":`export-panel`,children:[T?(0,V.jsx)(Vr,{versions:h,shown:i.shown,picked:C,onPick:w,onBack:()=>{E(!1)},words:s}):ie?(0,V.jsxs)(`div`,{className:`flex items-center gap-3 p-4`,children:[(0,V.jsx)(`span`,{className:`text-lead`,children:s.format}),(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:R}),z]}):(0,V.jsxs)(V.Fragment,{children:[(m.types.length>1||g.length>1||m.extras.length+j.length>0)&&(0,V.jsxs)(`div`,{className:`grid grid-cols-[max-content_minmax(0,1fr)] items-center gap-x-4 gap-y-2 px-4 pt-4 pb-2`,children:[m.types.length>1&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-lead`,children:s.format}),R]}),j.map(e=>e.values?(0,V.jsxs)(B.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-lead`,children:s.option[e.name]?.label}),(0,V.jsxs)(Qn,{value:String(y.options[e.name]??e.values[0]),onValueChange:t=>{te(e.name,t)},children:[(0,V.jsx)(er,{size:`sm`,"aria-label":s.option[e.name]?.label,className:`w-full min-w-0`,"data-testid":`export-option-${e.name}`,children:(0,V.jsx)($n,{})}),(0,V.jsx)(tr,{position:`popper`,align:`start`,children:e.values.map(t=>(0,V.jsx)(nr,{value:t,"data-value":t,children:s.option[e.name]?.values?.[t]??t},t))})]})]},e.name):null),g.length>1&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-lead`,children:s.versions}),(0,V.jsxs)(Qn,{value:x,onValueChange:e=>{S(e),e===`some`&&E(!0)},children:[(0,V.jsx)(er,{size:`sm`,"aria-label":s.versions,className:`w-full min-w-0`,"data-testid":`export-scope`,children:(0,V.jsx)($n,{})}),(0,V.jsxs)(tr,{position:`popper`,align:`start`,children:[(0,V.jsx)(nr,{value:`shown`,children:_??s.onShow}),(0,V.jsx)(nr,{value:`all`,children:s.all(g.length)}),(0,V.jsx)(rr,{}),(0,V.jsx)(nr,{value:`some`,onPointerUp:()=>{E(!0)},children:x===`some`?s.chosen(C.length):s.choose})]})]})]}),m.extras.length+P.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-lead self-start`,children:s.include}),(0,V.jsxs)(`div`,{className:`grid gap-1.5`,"data-testid":`export-include`,children:[P.map(e=>(0,V.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(ur,{checked:y.options[e.name]===!0,"data-option":e.name,onCheckedChange:t=>{te(e.name,t===!0)}}),(0,V.jsx)(`span`,{className:`truncate`,children:s.option[e.name]?.label})]},e.name)),m.extras.map(e=>{let t=v[e];return(0,V.jsxs)(`label`,{title:t,className:n(`flex items-center gap-2`,t!==void 0&&`text-lead-soft`),children:[(0,V.jsx)(ur,{checked:t===void 0&&y.extras.includes(e),disabled:t!==void 0,"data-type":e,onCheckedChange:t=>{b({...y,extras:t===!0?[...y.extras,e]:y.extras.filter(t=>t!==e)})}}),(0,V.jsx)(`span`,{className:`truncate`,children:Nr(s,e)})]},e)})]})]})]}),F>0&&(0,V.jsxs)(`p`,{className:`text-dense text-destructive flex items-start gap-1.5 px-4 pt-2`,"data-testid":`export-blocked`,children:[(0,V.jsx)(r,{className:`mt-0.5 size-3.5 flex-none`,"aria-hidden":!0}),s.blocked(F)]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 px-4 pt-3 pb-4`,children:[(0,V.jsx)(`span`,{className:`text-lead min-w-0 flex-1 truncate text-xs`,children:i.facts??(m.types.length===1?Nr(s,y.type):void 0)}),z]})]}),a.length>0&&(0,V.jsx)(`div`,{className:`max-h-56 overflow-y-auto`,children:a.map(e=>(0,V.jsx)(Br,{job:e,versions:h,ahead:Dr(o,e.id),words:s,reveals:c},e.id))})]})}function Ur(e){let t=/Mac|iPhone|iPad/u.test(navigator.userAgent),n=e.target;return e.code===`KeyE`&&(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.shiftKey&&!e.altKey&&!(n instanceof HTMLElement&&(n.isContentEditable||n.tagName===`INPUT`||n.tagName===`TEXTAREA`))}function Wr(e){let t=L(),n=t?.item.kind,i=t?.item.dir,a=jr.of(t?.locale),o=Pr(),s=(0,B.useRef)(null),[c,l]=(0,B.useState)(!1),{all:u,fresh:d,reveals:f}=Fr(c);if(ee(`editor/command`,()=>{l(e=>!e)}),(0,B.useEffect)(()=>{let e=e=>{Ur(e)&&(e.preventDefault(),l(e=>!e))};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[]),(0,B.useEffect)(()=>{if(!c||o)return;let e=()=>{l(!1)};return window.addEventListener(`blur`,e),()=>{window.removeEventListener(`blur`,e)}},[c,o]),n===void 0||i===void 0||!p[n])return null;let m=Sr(u,i),h=kr(m,d),g=(0,V.jsxs)($,{"data-testid":`export`,"data-state":h.at,"aria-pressed":c,"aria-label":h.at===`running`?a.running(h.percent):void 0,onClick:()=>{o&&l(!0)},children:[h.at===`running`&&(0,V.jsx)(Lr,{percent:h.percent}),h.at===`queued`&&(0,V.jsx)(Lr,{percent:0}),h.at===`done`&&(0,V.jsx)(Te,{className:`text-success`,"aria-hidden":!0}),h.at===`failed`&&(0,V.jsx)(r,{className:`text-destructive`,"aria-hidden":!0}),h.at===`idle`&&(0,V.jsx)(ke,{"aria-hidden":!0}),h.at===`running`?`${String(h.percent)}%`:h.at===`queued`?a.queued:h.at===`done`?a.exported:h.at===`failed`?a.exportFailed:a.export]}),_=(0,V.jsx)(Hr,{kind:n,item:i,props:e,jobs:m,all:u,words:a,reveals:f,startRef:s});return o?(0,V.jsxs)(V.Fragment,{children:[g,(0,V.jsx)(gr,{open:c,onOpenChange:l,children:(0,V.jsxs)(yr,{side:`bottom`,showCloseButton:!1,className:`gap-0 rounded-t-lg`,children:[(0,V.jsx)(br,{className:`sr-only`,children:a.export}),_]})})]}):(0,V.jsxs)(dr,{open:c,onOpenChange:l,children:[(0,V.jsx)(fr,{asChild:!0,children:g}),(0,V.jsxs)(pr,{align:`end`,sideOffset:8,className:`w-80 p-0`,onOpenAutoFocus:e=>{s.current&&!s.current.disabled&&(e.preventDefault(),s.current.focus())},children:[(0,V.jsx)(lr,{}),_]})]})}var Gr=800;function Kr({saved:e,words:t}){let r=e.state===`saving`||e.state===`unsaved`,[i,a]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{if(!r)return;let e=setTimeout(()=>{a(!0)},Gr);return()=>{clearTimeout(e),a(!1)}},[r]),e.state===`saved`||r&&!i?null:(0,V.jsx)(`span`,{"data-testid":`save-state`,"data-state":e.state,title:e.message,className:n(`px-1 text-xs`,e.state===`error`?`text-destructive`:`text-lead`),children:t.saved[e.state]})}function qr({start:e,saved:t,exports:n}){let r=L(),i=jr.of(r?.locale),a=r!==void 0&&p[r.item.kind]!==void 0;return!e&&!t&&!a?null:(0,V.jsxs)(`div`,{className:`bg-background flex min-h-9 flex-none items-center gap-1 border-b px-1 font-sans text-sm`,"data-testid":`item-bar`,children:[e,(0,V.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[t&&(0,V.jsx)(Kr,{saved:t,words:i}),(0,V.jsx)(Wr,{...n})]})]})}function Jr({children:e}){return(0,V.jsx)(`span`,{className:`before:bg-rule relative flex h-8 flex-none items-center gap-0.5 pl-2 before:absolute before:top-2 before:bottom-2 before:left-0.75 before:w-px`,children:e})}function Yr({testid:e,className:t,children:r,...i}){let a=L(),o=jr.of(a?.locale),s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useRef)(null),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(()=>{let t=e.firstElementChild?.getBoundingClientRect().height??0,n=e.getBoundingClientRect().height>t*1.5;d(n),n||p(!1)});return t.observe(e),()=>{t.disconnect()}},[]),(0,B.useEffect)(()=>{if(!f)return;let e=e=>{let t=e.target;t instanceof Element&&(t.closest(`[data-radix-popper-content-wrapper]`)||s.current?.contains(t)||l.current?.contains(t)||p(!1))},t=e=>{e.key===`Escape`&&p(!1)};return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`keydown`,t)}},[f]),(0,V.jsxs)(`div`,{className:n(`relative h-8 min-w-0 flex-1`,t),children:[(0,V.jsx)(`div`,{...i,ref:s,className:`data-[open]:bg-background absolute top-0 right-7.5 left-0 h-8 overflow-hidden data-[open]:z-30 data-[open]:h-auto data-[open]:rounded-b-md data-[open]:shadow-md`,"data-testid":e,"data-open":f?``:void 0,children:(0,V.jsx)(`div`,{ref:c,className:`-ml-2 flex flex-wrap items-center`,children:r})}),u?(0,V.jsx)($,{ref:l,icon:!0,className:`absolute top-0.5 right-0.5`,"aria-label":o.moreTools,title:o.moreTools,"aria-expanded":f,"data-testid":`${e}-more`,onMouseDown:e=>{e.preventDefault()},onClick:()=>{p(!f)},children:(0,V.jsx)(Ae,{})}):null]})}export{be as C,Ce as S,Oe as _,mr as a,Te as b,ur as c,Qn as d,tr as f,Le as g,$n as h,dr as i,$ as l,er as m,Yr as n,pr as o,nr as p,qr as r,fr as s,Jr as t,or as u,De as v,we as x,Ee as y};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{At as n,Ct as r,Dt as i,Et as a,Mt as o,Ot as s,Rt as c,a as l,bt as u,c as d,d as f,dt as p,f as m,ft as h,gt as g,ht as _,i as v,jt as y,kt as b,l as x,lt as S,n as C,o as w,ot as T,pt as E,r as D,rn as O,s as k,tt as A,u as j,ut as ee,yt as M}from"./react-D54s6gwK.js";import{C as te,_ as N,d as ne,f as re,g as ie,h as ae,p as oe,r as se,u as ce,x as le,y as ue}from"./dist-Cg2PdedY.js";import{T as de}from"./index-pwRfZ2Jv.js";var fe=s(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),pe=s(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),P=s(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),me=s(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),he=s(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),F=t(O(),1),I=b(),L=Object.defineProperty,R=(e,t)=>L(e,`name`,{value:t,configurable:!0}),[ge,_e]=_(`Tooltip`,[m]),z=m(),B=`TooltipProvider`,ve=700,V=`tooltip.open`,[ye,H]=ge(B),be=R(e=>{let{__scopeTooltip:t,delayDuration:n=ve,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=F.useRef(!0),s=F.useRef(!1),c=F.useRef(0);return F.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,I.jsx)(ye,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:F.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:F.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:F.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),U=`Tooltip`,[xe,W]=ge(U),Se=R(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=H(U,e.__scopeTooltip),l=z(t),[u,f]=F.useState(null),[m,h]=F.useState(void 0),g=S(),_=F.useRef(0),v=o??c.disableHoverableContent,y=s??c.delayDuration,b=F.useRef(!1),[x,C]=p({prop:r,defaultProp:i??!1,onChange:R(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(V))):c.onClose(),a?.(e)},`onChange`),caller:U}),w=F.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),T=F.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,C(!0)},[C]),E=F.useCallback(()=>{window.clearTimeout(_.current),_.current=0,C(!1)},[C]),D=F.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,C(!0),_.current=0},y)},[y,C]);F.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let O=m??g;return(0,I.jsx)(d,{...l,children:(0,I.jsx)(xe,{scope:t,contentId:O,setContentId:h,open:x,stateAttribute:w,trigger:u,onTriggerChange:f,onTriggerEnter:F.useCallback(()=>{c.isOpenDelayedRef.current?D():T()},[c.isOpenDelayedRef,D,T]),onTriggerLeave:F.useCallback(()=>{v?E():(window.clearTimeout(_.current),_.current=0)},[E,v]),onOpen:T,onClose:E,disableHoverableContent:v,children:n})})},`Tooltip`),Ce=`TooltipTrigger`,we=F.forwardRef(R(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=W(Ce,n),o=H(Ce,n),s=z(n),c=F.useRef(null),l=u(t,c,a.onTriggerChange),d=F.useRef(!1),f=F.useRef(!1),p=F.useCallback(()=>d.current=!1,[]);return F.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),(0,I.jsx)(x,{asChild:!0,...s,children:(0,I.jsx)(g.button,{"aria-describedby":a.open?Re(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:l,onPointerMove:E(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),f.current=!0)}),onPointerLeave:E(e.onPointerLeave,()=>{a.onTriggerLeave(),f.current=!1}),onPointerDown:E(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:E(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:E(e.onBlur,a.onClose),onClick:E(e.onClick,a.onClose)})})},`TooltipTrigger`)),Te=`TooltipPortal`,[G,Ee]=ge(Te,{forceMount:void 0}),De=R(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=W(Te,t);return(0,I.jsx)(G,{scope:t,forceMount:n,children:(0,I.jsx)(ee,{present:n||a.open,children:(0,I.jsx)(A,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),K=`TooltipContent`,Oe=F.forwardRef(R(function(e,t){let n=Ee(K,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=W(K,e.__scopeTooltip);return(0,I.jsx)(ee,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(Ae,{side:i,...a,ref:t}):(0,I.jsx)(q,{side:i,...a,ref:t})})},`TooltipContent`)),q=F.forwardRef(R(function(e,t){let n=W(K,e.__scopeTooltip),r=H(K,e.__scopeTooltip),i=F.useRef(null),a=u(t,i),[o,s]=F.useState(null),{trigger:c,onClose:l}=n,d=i.current,{onPointerInTransitChange:f}=r,p=F.useCallback(()=>{s(null),f(!1)},[f]),m=F.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Ne(r,Me(r,n.getBoundingClientRect())),a=Pe(t.getBoundingClientRect()),o=Ie([...i,...a]);s(o),f(!0)},[f]);return F.useEffect(()=>()=>p(),[p]),F.useEffect(()=>{if(c&&d){let e=R(e=>m(e,d),`handleTriggerLeave`),t=R(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[c,d,m,p]),F.useEffect(()=>{if(o){let e=R(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!Fe(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,l,p]),(0,I.jsx)(Ae,{...e,ref:a})},`TooltipContentHoverable`)),ke=M(`TooltipContent`),Ae=F.forwardRef(R(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=W(K,n),u=z(n),{onClose:d}=l;F.useEffect(()=>(document.addEventListener(V,d),()=>document.removeEventListener(V,d)),[d]),F.useEffect(()=>{if(l.trigger){let e=R(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:p}=l;return h(()=>(p(a),()=>{p(void 0)}),[a,p]),(0,I.jsx)(T,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,I.jsxs)(f,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,I.jsx)(ke,{children:r}),i?(0,I.jsx)(ie,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),je=F.forwardRef(R(function(e,t){let{__scopeTooltip:n,...r}=e,i=z(n);return(0,I.jsx)(j,{...i,...r,ref:t})},`TooltipArrow`));function Me(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}R(Me,`getExitSideFromRect`);function Ne(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}R(Ne,`getPaddedExitPoints`);function Pe(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}R(Pe,`getPointsFromRect`);function Fe(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}R(Fe,`isPointInPolygon`);function Ie(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Le(t)}R(Ie,`getHull`);function Le(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}R(Le,`getHullPresorted`);function Re(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}R(Re,`concatAriaDescribedby`);function ze({className:e,...t}){return(0,I.jsx)(`span`,{className:r(`text-muted-foreground font-mono text-micro leading-4 font-normal tracking-label uppercase`,e),...t})}function Be({label:e,count:t=4,size:n=10,className:i}){return(0,I.jsx)(`span`,{role:`status`,"aria-label":e,className:r(`inline-flex items-end gap-[3px]`,i),children:Array.from({length:t},(e,t)=>(0,I.jsx)(`span`,{className:`bg-foreground animate-squares-drop block`,style:{width:n,height:n,animationDelay:`${String(t*120)}ms`}},t))})}function Ve({title:e,children:t,action:n,className:i}){return(0,I.jsxs)(`div`,{className:r(`animate-set-in flex flex-col items-center gap-5 px-6 py-16 text-center`,i),children:[(0,I.jsxs)(`div`,{className:`flex max-w-sm flex-col gap-1.5`,children:[(0,I.jsx)(`h2`,{className:`font-serif text-heading font-semibold`,children:e}),t?(0,I.jsx)(`div`,{className:`text-muted-foreground text-sm leading-relaxed`,children:t}):null]}),n]})}var He=e=>Number.isFinite(e)&&e>0?e:0,J=e=>{let t=He(e);return`${String(Math.floor(t/60))}:${String(Math.floor(t%60)).padStart(2,`0`)}`},Y=e=>{let t=He(e);return`${String(Math.floor(t/60))}:${(t%60).toFixed(1).padStart(4,`0`)}`},Ue=(e,t)=>Math.floor(e*t+1e-9)/t,We=e=>e.split(/[/\\]/u).at(-1)??e,Ge={loading:`Vorschau wird geladen`,loadFailed:`Die Vorschau wurde nicht geladen`,noVideo:`Das ist kein Video`,previewTitle:`Vorschau`,denoising:`Sprache wird entrauscht; Wiedergabe wie aufgenommen`,uncut:e=>`Noch keine Personenmaske für ${e}: Ebenen hinter der Person erscheinen davor`,play:`Abspielen`,pause:`Pause`,seek:`Springen`,prevPage:`Vorherige Seite`,nextPage:`Nächste Seite`,pageOf:(e,t)=>`Seite ${String(e)} von ${String(t)}`,timeOf:(e,t,n)=>`${e} von ${t}${n?`, ${n}`:``}`,hideTimeline:`Zeitleiste ausblenden`,showTimeline:`Zeitleiste einblenden`,rows:{scenes:`Szenen`,voice:`Sprache`,music:`Musik`,sound:`Ton`},noVoice:`Keine Sprache`,noMusic:`Keine Musik`,noCues:`Keine Soundeffekte`,ducked:`unter Sprache abgesenkt`,version:`Sprache`,close:`Schließen`,previewFailed:`Mit diesem Video ist etwas schiefgelaufen.`,previewFailedKept:`Bei der letzten Änderung ist etwas schiefgelaufen. Das ist die letzte Version, die funktioniert hat.`,problemsHere:e=>e===1?`1 Problem in dieser Version`:`${String(e)} Probleme in dieser Version`,levelError:`Muss behoben werden`,levelWarn:`Vorschlag`},Ke={loading:`Loading the preview`,loadFailed:`The preview did not load`,noVideo:`This is not a video`,previewTitle:`Preview`,denoising:`Denoising the speech; playing it as recorded`,uncut:e=>`No person matte for ${e} yet: layers behind the person show in front`,play:`Play`,pause:`Pause`,seek:`Seek`,prevPage:`Previous page`,nextPage:`Next page`,pageOf:(e,t)=>`Page ${String(e)} of ${String(t)}`,timeOf:(e,t,n)=>`${e} of ${t}${n?`, ${n}`:``}`,hideTimeline:`Hide timeline`,showTimeline:`Show timeline`,rows:{scenes:`Scenes`,voice:`Speech`,music:`Music`,sound:`Sound`},noVoice:`No speech`,noMusic:`No music`,noCues:`No sound cues`,ducked:`lowered under speech`,version:`Language`,close:`Close`,previewFailed:`Something went wrong with this video.`,previewFailedKept:`Something went wrong with the latest change. This is the last version that worked.`,problemsHere:e=>`${String(e)} problem${e===1?``:`s`} in this version`,levelError:`Must fix`,levelWarn:`Suggestion`},qe={loading:`Cargando la vista previa`,loadFailed:`La vista previa no se cargó`,noVideo:`Esto no es un video`,previewTitle:`Vista previa`,denoising:`Reduciendo el ruido de la voz; se reproduce tal como se grabó`,uncut:e=>`Aún no hay máscara de persona para ${e}: las capas detrás de la persona se ven delante`,play:`Reproducir`,pause:`Pausa`,seek:`Buscar`,prevPage:`Página anterior`,nextPage:`Página siguiente`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,timeOf:(e,t,n)=>`${e} de ${t}${n?`, ${n}`:``}`,hideTimeline:`Ocultar la línea de tiempo`,showTimeline:`Mostrar la línea de tiempo`,rows:{scenes:`Escenas`,voice:`Voz`,music:`Música`,sound:`Sonido`},noVoice:`Sin voz`,noMusic:`Sin música`,noCues:`Sin efectos de sonido`,ducked:`bajada bajo la voz`,version:`Idioma`,close:`Cerrar`,previewFailed:`Algo salió mal con este video.`,previewFailedKept:`Algo salió mal con el último cambio. Esta es la última versión que funcionó.`,problemsHere:e=>e===1?`1 problema en esta versión`:`${String(e)} problemas en esta versión`,levelError:`Corregir`,levelWarn:`Sugerencia`},Je={loading:`Chargement de l’aperçu`,loadFailed:`L’aperçu ne s’est pas chargé`,noVideo:`Ce n’est pas une vidéo`,previewTitle:`Aperçu`,denoising:`Débruitage de la voix\xA0; lecture telle qu’enregistrée`,uncut:e=>`Pas encore de masque de personne pour ${e}\u00a0: les calques derrière la personne passent devant`,play:`Lire`,pause:`Pause`,seek:`Position`,prevPage:`Page précédente`,nextPage:`Page suivante`,pageOf:(e,t)=>`Page ${String(e)} sur ${String(t)}`,timeOf:(e,t,n)=>`${e} sur ${t}${n?`, ${n}`:``}`,hideTimeline:`Masquer la timeline`,showTimeline:`Afficher la timeline`,rows:{scenes:`Scènes`,voice:`Voix`,music:`Musique`,sound:`Son`},noVoice:`Pas de voix`,noMusic:`Pas de musique`,noCues:`Pas d’effets sonores`,ducked:`baissée sous la voix`,version:`Langue`,close:`Fermer`,previewFailed:`Un problème est survenu avec cette vidéo.`,previewFailedKept:`Un problème est survenu avec la dernière modification. Voici la dernière version qui fonctionnait.`,problemsHere:e=>e===1?`1 problème dans cette version`:`${String(e)} problèmes dans cette version`,levelError:`À corriger`,levelWarn:`Suggestion`},Ye=new Intl.PluralRules(`hi`),Xe=(e,t,n)=>`${String(e)} ${Ye.select(e)===`one`?t:n}`,Ze={loading:`प्रीव्यू लोड हो रहा है`,loadFailed:`प्रीव्यू लोड नहीं हुआ`,noVideo:`यह वीडियो नहीं है`,previewTitle:`प्रीव्यू`,denoising:`आवाज़ से शोर हटाया जा रहा है; तब तक रिकॉर्डिंग जैसी है वैसी चल रही है`,uncut:e=>`${e} के लिए अभी पर्सन मैट नहीं है: व्यक्ति के पीछे वाली लेयर आगे दिखती हैं`,play:`चलाएँ`,pause:`रोकें`,seek:`आगे-पीछे करें`,prevPage:`पिछला पेज`,nextPage:`अगला पेज`,pageOf:(e,t)=>`पेज ${String(e)} / ${String(t)}`,timeOf:(e,t,n)=>`${t} में से ${e}${n?`, ${n}`:``}`,hideTimeline:`टाइमलाइन छिपाएँ`,showTimeline:`टाइमलाइन दिखाएँ`,rows:{scenes:`सीन`,voice:`आवाज़`,music:`संगीत`,sound:`साउंड`},noVoice:`कोई आवाज़ नहीं`,noMusic:`कोई संगीत नहीं`,noCues:`कोई साउंड इफ़ेक्ट नहीं`,ducked:`बोलते समय धीमा`,version:`भाषा`,close:`बंद करें`,previewFailed:`इस वीडियो में कुछ गड़बड़ हो गई।`,previewFailedKept:`सबसे नए बदलाव में कुछ गड़बड़ हो गई। यह आखिरी चलने वाला वर्शन है।`,problemsHere:e=>`इस वर्शन में ${Xe(e,`समस्या`,`समस्याएँ`)}`,levelError:`ठीक करना ज़रूरी`,levelWarn:`सुझाव`},Qe={loading:`Caricamento dell'anteprima`,loadFailed:`L'anteprima non si è caricata`,noVideo:`Questo non è un video`,previewTitle:`Anteprima`,denoising:`Riduzione del rumore della voce; riprodotta così come è stata registrata`,uncut:e=>`Ancora nessuna maschera della persona per ${e}: i livelli dietro la persona appaiono davanti`,play:`Riproduci`,pause:`Pausa`,seek:`Vai a`,prevPage:`Pagina precedente`,nextPage:`Pagina successiva`,pageOf:(e,t)=>`Pagina ${String(e)} di ${String(t)}`,timeOf:(e,t,n)=>`${e} di ${t}${n?`, ${n}`:``}`,hideTimeline:`Nascondi la timeline`,showTimeline:`Mostra la timeline`,rows:{scenes:`Scene`,voice:`Voce`,music:`Musica`,sound:`Suono`},noVoice:`Nessuna voce`,noMusic:`Nessuna musica`,noCues:`Nessun effetto sonoro`,ducked:`abbassata sotto la voce`,version:`Lingua`,close:`Chiudi`,previewFailed:`Qualcosa è andato storto con questo video.`,previewFailedKept:`Qualcosa è andato storto con l'ultima modifica. Questa è l'ultima versione che funzionava.`,problemsHere:e=>e===1?`1 problema in questa versione`:`${String(e)} problemi in questa versione`,levelError:`Da correggere`,levelWarn:`Suggerimento`},$e={loading:`プレビューを読み込み中`,loadFailed:`プレビューを読み込めませんでした`,noVideo:`これは動画ではありません`,previewTitle:`プレビュー`,denoising:`音声のノイズを除去中。録音のまま再生しています`,uncut:e=>`${e} の人物マットはまだありません。人物の後ろのレイヤーが前に表示されます`,play:`再生`,pause:`一時停止`,seek:`再生位置`,prevPage:`前のページ`,nextPage:`次のページ`,pageOf:(e,t)=>`${String(e)} / ${String(t)} ページ`,timeOf:(e,t,n)=>`${e} / ${t}${n?`、${n}`:``}`,hideTimeline:`タイムラインを隠す`,showTimeline:`タイムラインを表示`,rows:{scenes:`シーン`,voice:`音声`,music:`音楽`,sound:`効果音`},noVoice:`音声なし`,noMusic:`音楽なし`,noCues:`効果音なし`,ducked:`音声の間は音量を下げる`,version:`言語`,close:`閉じる`,previewFailed:`この動画で問題が起きました。`,previewFailedKept:`最新の変更で問題が起きました。これは最後に正しく動いたバージョンです。`,problemsHere:e=>`このバージョンに ${String(e)} 件の問題`,levelError:`要修正`,levelWarn:`提案`},et={loading:`미리보기를 불러오는 중`,loadFailed:`미리보기를 불러오지 못했습니다`,noVideo:`동영상이 아닙니다`,previewTitle:`미리보기`,denoising:`음성의 잡음을 제거하는 중입니다. 녹음된 그대로 재생합니다`,uncut:e=>`${e}의 인물 매트가 아직 없습니다. 인물 뒤 레이어가 앞에 보입니다`,play:`재생`,pause:`일시정지`,seek:`재생 위치`,prevPage:`이전 페이지`,nextPage:`다음 페이지`,pageOf:(e,t)=>`${String(t)}페이지 중 ${String(e)}페이지`,timeOf:(e,t,n)=>`${e} / ${t}${n?`, ${n}`:``}`,hideTimeline:`타임라인 숨기기`,showTimeline:`타임라인 보기`,rows:{scenes:`장면`,voice:`음성`,music:`음악`,sound:`사운드`},noVoice:`음성 없음`,noMusic:`음악 없음`,noCues:`효과음 없음`,ducked:`음성 아래로 낮춤`,version:`언어`,close:`닫기`,previewFailed:`이 동영상에 문제가 생겼습니다.`,previewFailedKept:`최근 변경에서 문제가 생겼습니다. 마지막으로 정상 작동한 버전입니다.`,problemsHere:e=>`이 버전의 문제 ${String(e)}개`,levelError:`수정 필요`,levelWarn:`제안`},tt={loading:`Carregando a prévia`,loadFailed:`A prévia não carregou`,noVideo:`Isto não é um vídeo`,previewTitle:`Prévia`,denoising:`Removendo o ruído da fala; tocando como foi gravada`,uncut:e=>`Ainda não há máscara de pessoa para ${e}: as camadas atrás da pessoa aparecem na frente`,play:`Reproduzir`,pause:`Pausar`,seek:`Posição`,prevPage:`Página anterior`,nextPage:`Próxima página`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,timeOf:(e,t,n)=>`${e} de ${t}${n?`, ${n}`:``}`,hideTimeline:`Ocultar a linha do tempo`,showTimeline:`Mostrar a linha do tempo`,rows:{scenes:`Cenas`,voice:`Fala`,music:`Música`,sound:`Som`},noVoice:`Sem fala`,noMusic:`Sem música`,noCues:`Sem efeitos sonoros`,ducked:`abaixada sob a fala`,version:`Idioma`,close:`Fechar`,previewFailed:`Algo deu errado com este vídeo.`,previewFailedKept:`Algo deu errado com a última alteração. Esta é a última versão que funcionou.`,problemsHere:e=>e===1?`1 problema nesta versão`:`${String(e)} problemas nesta versão`,levelError:`Corrigir`,levelWarn:`Sugestão`},nt=new Intl.PluralRules(`ru`),rt=(e,t,n,r)=>{let i=nt.select(e);return`${String(e)} ${i===`one`?t:i===`many`?r:n}`},it=y({en:Ke,"zh-cn":{loading:`正在加载预览`,loadFailed:`预览没能加载`,noVideo:`这不是视频`,previewTitle:`预览`,denoising:`正在降噪,先播原声`,uncut:e=>`${e} 还没有人像遮罩:人物后面的图层暂时画在人物前面`,play:`播放`,pause:`暂停`,seek:`进度`,prevPage:`上一页`,nextPage:`下一页`,pageOf:(e,t)=>`第 ${String(e)} 页,共 ${String(t)} 页`,timeOf:(e,t,n)=>`${e} / ${t}${n?`,${n}`:``}`,hideTimeline:`收起时间线`,showTimeline:`展开时间线`,rows:{scenes:`分段`,voice:`说话`,music:`音乐`,sound:`音效`},noVoice:`没有人说话`,noMusic:`没有音乐`,noCues:`没有音效`,ducked:`有人说话时压低`,version:`语言`,close:`关闭`,previewFailed:`这个视频出了点问题。`,previewFailedKept:`最新的改动出了点问题,这里是上一版正常的画面。`,problemsHere:e=>`这个版本有 ${String(e)} 个问题`,levelError:`必须改`,levelWarn:`建议`},"zh-tw":{loading:`正在載入預覽`,loadFailed:`預覽未能載入`,noVideo:`這不是影片`,previewTitle:`預覽`,denoising:`正在降噪,先播放原始錄音`,uncut:e=>`${e} 還沒有人像遮罩:人物後方的圖層暫時顯示在人物前面`,play:`播放`,pause:`暫停`,seek:`播放位置`,prevPage:`上一頁`,nextPage:`下一頁`,pageOf:(e,t)=>`第 ${String(e)} 頁,共 ${String(t)} 頁`,timeOf:(e,t,n)=>`${e} / ${t}${n?`,${n}`:``}`,hideTimeline:`收合時間軸`,showTimeline:`展開時間軸`,rows:{scenes:`段落`,voice:`語音`,music:`音樂`,sound:`音效`},noVoice:`沒有語音`,noMusic:`沒有音樂`,noCues:`沒有音效`,ducked:`有語音時降低音量`,version:`語言`,close:`關閉`,previewFailed:`這部影片出了點問題。`,previewFailedKept:`最新的修改出了點問題,這裡是上一個正常的版本。`,problemsHere:e=>`這個版本有 ${String(e)} 個問題`,levelError:`必須修正`,levelWarn:`建議`},ja:$e,ko:et,es:qe,fr:Je,de:Ge,it:Qe,pt:tt,ru:{loading:`Загрузка предпросмотра`,loadFailed:`Предпросмотр не загрузился`,noVideo:`Это не видео`,previewTitle:`Предпросмотр`,denoising:`Шумоподавление речи; пока звучит исходная запись`,uncut:e=>`Для ${e} ещё нет маски человека: слои за человеком показаны перед ним`,play:`Воспроизвести`,pause:`Пауза`,seek:`Перемотка`,prevPage:`Предыдущая страница`,nextPage:`Следующая страница`,pageOf:(e,t)=>`Страница ${String(e)} из ${String(t)}`,timeOf:(e,t,n)=>`${e} из ${t}${n?`, ${n}`:``}`,hideTimeline:`Скрыть таймлайн`,showTimeline:`Показать таймлайн`,rows:{scenes:`Сцены`,voice:`Речь`,music:`Музыка`,sound:`Звук`},noVoice:`Нет речи`,noMusic:`Нет музыки`,noCues:`Нет звуковых эффектов`,ducked:`приглушено под речью`,version:`Язык`,close:`Закрыть`,previewFailed:`С этим видео что-то пошло не так.`,previewFailedKept:`С последним изменением что-то пошло не так. Это последняя рабочая версия.`,problemsHere:e=>`${rt(e,`проблема`,`проблемы`,`проблем`)} в этой версии`,levelError:`Нужно исправить`,levelWarn:`Совет`},tr:{loading:`Önizleme yükleniyor`,loadFailed:`Önizleme yüklenmedi`,noVideo:`Bu bir video değil`,previewTitle:`Önizleme`,denoising:`Konuşmadaki gürültü temizleniyor; kaydedildiği gibi çalınıyor`,uncut:e=>`${e} için henüz kişi maskesi yok: kişinin arkasındaki katmanlar önde görünür`,play:`Oynat`,pause:`Duraklat`,seek:`Konum`,prevPage:`Önceki sayfa`,nextPage:`Sonraki sayfa`,pageOf:(e,t)=>`Sayfa ${String(e)} / ${String(t)}`,timeOf:(e,t,n)=>`${e} / ${t}${n?`, ${n}`:``}`,hideTimeline:`Zaman çizelgesini gizle`,showTimeline:`Zaman çizelgesini göster`,rows:{scenes:`Sahneler`,voice:`Konuşma`,music:`Müzik`,sound:`Ses`},noVoice:`Konuşma yok`,noMusic:`Müzik yok`,noCues:`Ses efekti yok`,ducked:`konuşmanın altında kısıldı`,version:`Dil`,close:`Kapat`,previewFailed:`Bu videoda bir şeyler ters gitti.`,previewFailedKept:`Son değişiklikte bir şeyler ters gitti. Bu, çalışan son sürüm.`,problemsHere:e=>`Bu sürümde ${String(e)} sorun var`,levelError:`Düzeltilmeli`,levelWarn:`Öneri`},vi:{loading:`Đang tải bản xem trước`,loadFailed:`Không tải được bản xem trước`,noVideo:`Đây không phải video`,previewTitle:`Xem trước`,denoising:`Đang khử nhiễu giọng nói; tạm phát như bản thu gốc`,uncut:e=>`Chưa có mặt nạ người cho ${e}: các lớp phía sau người hiện ở phía trước`,play:`Phát`,pause:`Tạm dừng`,seek:`Tua`,prevPage:`Trang trước`,nextPage:`Trang sau`,pageOf:(e,t)=>`Trang ${String(e)}/${String(t)}`,timeOf:(e,t,n)=>`${e} / ${t}${n?`, ${n}`:``}`,hideTimeline:`Ẩn dòng thời gian`,showTimeline:`Hiện dòng thời gian`,rows:{scenes:`Cảnh`,voice:`Lời nói`,music:`Nhạc`,sound:`Âm thanh`},noVoice:`Không có lời nói`,noMusic:`Không có nhạc`,noCues:`Không có hiệu ứng âm thanh`,ducked:`giảm âm lượng khi có lời nói`,version:`Ngôn ngữ`,close:`Đóng`,previewFailed:`Video này đã gặp sự cố.`,previewFailedKept:`Thay đổi mới nhất đã gặp sự cố. Đây là phiên bản chạy được gần nhất.`,problemsHere:e=>`${String(e)} vấn đề trong phiên bản này`,levelError:`Cần sửa`,levelWarn:`Gợi ý`},th:{loading:`กำลังโหลดตัวอย่าง`,loadFailed:`โหลดตัวอย่างไม่สำเร็จ`,noVideo:`นี่ไม่ใช่วิดีโอ`,previewTitle:`ตัวอย่าง`,denoising:`กำลังลดเสียงรบกวนของเสียงพูด ระหว่างนี้จะเล่นตามที่บันทึกไว้`,uncut:e=>`ยังไม่มีมาสก์บุคคลสำหรับ ${e}: เลเยอร์ที่อยู่หลังบุคคลจะแสดงอยู่ด้านหน้า`,play:`เล่น`,pause:`หยุดชั่วคราว`,seek:`เลื่อนตำแหน่ง`,prevPage:`หน้าก่อนหน้า`,nextPage:`หน้าถัดไป`,pageOf:(e,t)=>`หน้า ${String(e)} จาก ${String(t)}`,timeOf:(e,t,n)=>`${e} จาก ${t}${n?`, ${n}`:``}`,hideTimeline:`ซ่อนไทม์ไลน์`,showTimeline:`แสดงไทม์ไลน์`,rows:{scenes:`ฉาก`,voice:`เสียงพูด`,music:`เพลง`,sound:`เสียง`},noVoice:`ไม่มีเสียงพูด`,noMusic:`ไม่มีเพลง`,noCues:`ไม่มีเอฟเฟกต์เสียง`,ducked:`ลดเสียงลงขณะมีเสียงพูด`,version:`ภาษา`,close:`ปิด`,previewFailed:`วิดีโอนี้เกิดข้อผิดพลาด`,previewFailedKept:`การเปลี่ยนแปลงล่าสุดเกิดข้อผิดพลาด นี่คือเวอร์ชันล่าสุดที่ใช้ได้`,problemsHere:e=>`มีปัญหา ${String(e)} รายการในเวอร์ชันนี้`,levelError:`ต้องแก้ไข`,levelWarn:`คำแนะนำ`},hi:Ze});function X(){return it.of(D()?.locale)}function at(e,t,n){let r=C(),[i,a]=(0,F.useState)(),o=JSON.stringify([e,t,...n]);return(0,F.useEffect)(()=>{if(t===void 0)return;let n=!0;return c(r,e,t).then(e=>{n&&a({key:o,data:e})},e=>{n&&a({key:o,error:e instanceof Error?e:Error(String(e))})}),()=>{n=!1}},[r,o]),{data:i?.data,error:i?.key===o?i.error:void 0}}function ot(){let[e,t]=(0,F.useState)(0);return v(`project/changed`,e=>{t(e.revision)}),e}function st(){let e=C(),[t,n]=(0,F.useState)();return(0,F.useEffect)(()=>{let t=!0;return c(e,`check/results`,{}).then(e=>{t&&n(t=>t??e)},()=>void 0),()=>{t=!1}},[e]),v(`check/changed`,n),t}function ct(e,t){let n=C(),[r,i]=(0,F.useState)();(0,F.useEffect)(()=>{let r=!0;return n[`storage/get`]({key:e}).then(n=>{r&&i({key:e,value:n.value===null?t:n.value})},()=>{r&&i({key:e,value:t})}),()=>{r=!1}},[n,e]);let a=(0,F.useCallback)(t=>{i({key:e,value:t}),n[`storage/set`]({key:e,value:t}).catch(()=>void 0)},[n,e]);return[r?.key===e?r.value:void 0,a]}async function lt(e,t){try{return(await e[`files/url`]({path:t})).url}catch{return}}function ut(e,t){return e.versions.find(e=>e.key===t)??e.versions[0]}function dt(e,t,n){return e.filter(e=>e.piece===t&&(e.combo===void 0||n.lang===void 0||e.combo.lang===n.lang))}function ft(e,t){try{return new Intl.DisplayNames([t],{type:`language`}).of(e)??e}catch{return e}}function pt(e){if(typeof e==`object`&&e&&e.allyhub===!0&&typeof e.type==`string`)return e}function mt(e,t){e?.postMessage({allyhub:!0,...t},`*`)}function ht({delayDuration:e=0,...t}){return(0,I.jsx)(be,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function gt({...e}){return(0,I.jsx)(Se,{"data-slot":`tooltip`,...e})}function _t({...e}){return(0,I.jsx)(we,{"data-slot":`tooltip-trigger`,...e})}function vt({className:e,sideOffset:t=0,children:n,...i}){return(0,I.jsx)(De,{children:(0,I.jsxs)(Oe,{"data-slot":`tooltip-content`,sideOffset:t,className:r(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...i,children:[n,(0,I.jsx)(je,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function yt(e,t,n,r=4){let i=e.map(({x:e,width:n},r)=>{let i=e+n>t&&e-n>=0?`before`:`after`;return i===`after`?{i:r,side:i,from:e,to:e+n}:{i:r,side:i,from:e-n,to:e}}),a=[],o=e.map(()=>null);for(let e of[...i].sort((e,t)=>e.from-t.from||e.i-t.i)){let t=0;for(;t<n&&(a[t]??-1/0)+r>e.from;)t++;t!==n&&(a[t]=e.to,o[e.i]={lane:t,side:e.side})}return o}var bt=.01,xt=new Map;async function St(e){try{let t=await fetch(e);if(!t.ok)return;let n=await t.arrayBuffer(),r=await new OfflineAudioContext(1,1,44100).decodeAudioData(n),i=r.sampleRate/50,a=Math.ceil(r.length/i),o=new Float32Array(a),s=0;for(let e=0;e<r.numberOfChannels;e++){let t=r.getChannelData(e);for(let e=0;e<a;e++){let n=Math.min(t.length,Math.floor((e+1)*i)),r=o[e]??0;for(let a=Math.floor(e*i);a<n;a++){let e=Math.abs(t[a]??0);e>r&&(r=e)}o[e]=r,r>s&&(s=r)}}if(s<bt)return;let c=Float32Array.from(o).sort(),l=c[Math.floor(c.length*.95)]??s;return{duration:r.duration,data:o,max:l>0?l:s}}catch{return}}function Ct(e){let t=xt.get(e);return t||(t=St(e),xt.set(e,t)),t}function wt(e){let[t,n]=(0,F.useState)();(0,F.useEffect)(()=>{if(e===void 0)return;let t=!0;return Ct(e).then(r=>{t&&n({url:e,peaks:r})}),()=>{t=!1}},[e]);let r=t?.url===e?t:void 0;return{peaks:r?.peaks,settled:e===void 0||r!==void 0}}function Tt(e,t,n){let r=Math.max(0,Math.floor(t*50)),i=Math.min(e.data.length,Math.max(r+1,Math.ceil(n*50))),a=0;for(let t=r;t<i;t++){let n=e.data[t]??0;n>a&&(a=n)}return a}function Et(e,t){if(e.length===0)return 0;let n=e[0];if(!n||t<=n.t)return n?.db??0;for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];if(r&&i&&t<=i.t)return i.t===r.t?i.db:r.db+(i.db-r.db)*(t-r.t)/(i.t-r.t)}return e.at(-1)?.db??0}function Dt(e,t,n){let r=new Map(t.map(e=>[e.key,e])),i=e.parts.flatMap(e=>{let t=e.speech;if(!t)return[];let n=r.get(e.key);return[{...n?.speechKey===void 0?{}:{key:n.speechKey},part:e.key,start:t.start,end:t.end,text:n?.spoken??``,file:t.file,from:t.from,speed:t.speed??1,...t.cuts?{cuts:t.cuts}:{}}]}),a=n?.music,o;if(a&&a.segments.length>0){let t=a.segments[0],n=a.segments.at(-1),r=Math.min(e.duration,a.until??(n?n.at+n.dur:e.duration)),i=[];for(let e=1;e<a.duck.length;e++){let t=a.duck[e-1],n=a.duck[e];if(t&&n&&t.db<0&&n.db<0){let e=i.at(-1);e&&Math.abs(e.end-t.t)<1e-9?e.end=n.t:i.push({start:t.t,end:n.t})}}o={file:a.file,start:t?.at??0,end:r,stretches:a.segments.map(e=>({at:e.at,from:e.from,dur:e.dur})),ducked:i,duck:a.duck,fadeIn:a.fadeIn,fadeOut:a.fadeOut}}return{cues:e.cues,speech:i,music:o}}function Ot(e,t){if(t<e.start||t>=e.end)return;let n=e.start,r=e.from;for(let i of e.cuts??[]){if(i.at>t)break;n=i.at,r=i.from}return r+(t-n)*e.speed}function kt(e,t){for(let n=e.stretches.length-1;n>=0;n--){let r=e.stretches[n];if(r&&t>=r.at&&t<r.at+r.dur)return r.from+(t-r.at)}}function At(e,t){let n=10**(Et(e.duck,t)/20);return e.fadeIn>0&&t-e.start<e.fadeIn&&(n*=Math.max(0,t-e.start)/e.fadeIn),e.fadeOut>0&&e.end-t<e.fadeOut&&(n*=Math.max(0,e.end-t)/e.fadeOut),Math.max(0,n)}function jt(e){let t=new Set((e.index??[]).filter(e=>e.matte).map(e=>e.file));return e.parts.flatMap(n=>{let r=(e.footage??[]).find(e=>e.part===n.key&&t.has(e.file));return r?[{part:n.key,file:r.file}]:[]})}var Mt={scenes:`text-track-scene`,voice:`text-track-voice`,music:`text-track-music`,sound:`text-track-sound`},Z={ruler:20,scenes:36,voice:40,music:32,sound:28};function Nt(e){return Z.ruler+1+Z.scenes+1+e.reduce((e,t)=>e+Z[t]+1,0)}var Pt=6;function Ft(e,t){let n=e=>e.join(` `).replace(/\s+([.,!?;:。,!?;:、])/g,`$1`).trim(),[r,...i]=e;if(r===t&&i.length>0){let e=n(i);if(/^[^a-z]/.test(e))return e}return n(e)}function It(e){return e<=60?{minor:1,major:5}:e<=180?{minor:1,major:10}:e<=600?{minor:5,major:30}:e<=1800?{minor:10,major:60}:{minor:60,major:300}}var Q=(e,t)=>`${String(e/Math.max(t,1e-6)*100)}%`;function Lt({title:e,mono:t=!1,time:n,line:i,children:a}){return(0,I.jsxs)(gt,{children:[(0,I.jsx)(_t,{asChild:!0,children:a}),(0,I.jsx)(vt,{side:`top`,sideOffset:6,className:`max-w-[20rem]`,children:(0,I.jsxs)(`span`,{className:`flex flex-col gap-0.5 text-left`,children:[(0,I.jsx)(`span`,{className:r(t&&`font-mono text-micro`),children:e}),(0,I.jsx)(`span`,{className:`font-mono text-micro tabular-nums opacity-70`,children:n}),i?(0,I.jsx)(`span`,{className:`opacity-80`,children:i}):null]})})]})}function Rt(e){let t=C(),[n,r]=(0,F.useState)();return(0,F.useEffect)(()=>{let n=!0;return lt(t,e).then(t=>{n&&r({file:e,url:t})}),()=>{n=!1}},[t,e]),n?.file===e?n.url:void 0}function zt({file:e,from:t,to:n,sample:i,alpha:a,className:o}){let s=(0,F.useRef)(null),{peaks:c,settled:l}=wt(Rt(e)),[u,d]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{let e=s.current;if(!e||!c)return;let r=()=>{let r=window.devicePixelRatio||1,o=Math.round(e.clientWidth*r),s=Math.round(e.clientHeight*r);if(!o||!s)return;e.width=o,e.height=s;let l=e.getContext(`2d`);if(!l)return;l.fillStyle=getComputedStyle(e).color,l.globalAlpha=a;let u=1/Math.max(c.max,.05),f=n-t,p=s-2*Math.round(2*r);for(let e=0;e<o;e+=2){let n=i(t+e/o*f);if(!n)continue;let r=Tt(c,n.at,n.at+2/o*f)*u*n.gain,a=Math.max(1,Math.round(Math.min(1,r)**Bt*p));l.fillRect(e,Math.round((s-a)/2),1,a)}d(!0)};r();let o=new ResizeObserver(r);o.observe(e);let l=new MutationObserver(r);return l.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>{o.disconnect(),l.disconnect()}},[c,t,n,i,a]),(0,I.jsx)(`canvas`,{ref:s,"aria-hidden":!0,"data-wave":u?`ready`:l?`none`:`pending`,className:r(`pointer-events-none absolute inset-0 size-full opacity-0 transition-opacity data-[wave=ready]:opacity-100`,o)})}var Bt=.7,Vt=`focus-visible:outline-ring absolute inset-y-1 overflow-hidden rounded-xs border focus-visible:outline-1 focus-visible:outline-solid focus-visible:-outline-offset-1`;function Ht({line:e,duration:t,onSeek:n}){let i=(0,F.useCallback)(t=>{let n=Ot(e,t);return n===void 0?void 0:{at:n,gain:1}},[e]);return(0,I.jsx)(Lt,{title:e.text,time:`${Y(e.start)} – ${Y(e.end)} · ${We(e.file)}`,children:(0,I.jsxs)(`button`,{type:`button`,"data-sentence":e.key??e.part,"data-start":e.start.toFixed(4),className:r(Vt,`bg-track-voice/15 border-track-voice/60 hover:bg-track-voice/25 text-left`),style:{left:Q(e.start,t),width:Q(e.end-e.start,t)},onPointerDown:e=>{e.stopPropagation()},onClick:()=>{n(e.start)},children:[(0,I.jsx)(`span`,{className:`absolute inset-x-1.5 top-0 block h-[14px] truncate text-micro leading-[14px]`,children:e.text}),(0,I.jsx)(`span`,{className:`absolute inset-x-0 top-[14px] bottom-0`,children:(0,I.jsx)(zt,{file:e.file,from:e.start,to:e.end,sample:i,alpha:.7,className:`text-track-voice`})})]})})}var Ut=2,Wt=.75;function Gt({parts:e,duration:t}){let n=(0,F.useRef)(null),r=(0,F.useRef)(new Map),[i,a]=(0,F.useState)(0),[o,s]=(0,F.useState)(()=>new Map),c=e.flatMap(e=>(e.anchors??[]).map(t=>({id:`${e.key}@${t.name}`,part:e.key,anchor:t}))),l=c.map(e=>e.id).join(`
|
|
2
|
-
`);(0,F.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{a(e.clientWidth);let t=new Map;for(let[e,n]of r.current)t.set(e,n.offsetWidth);s(e=>e.size===t.size&&[...t].every(([t,n])=>e.get(t)===n)?e:t)};t();let i=new ResizeObserver(t);i.observe(e);for(let e of r.current.values())i.observe(e);return()=>{i.disconnect()}},[l]);let u=yt(c.map(e=>({x:e.anchor.at/Math.max(t,1e-6)*i,width:o.get(e.id)??0})),i,Ut);return(0,I.jsx)(`div`,{ref:n,className:`pointer-events-none absolute inset-0`,children:c.map((e,n)=>(0,I.jsx)(Kt,{part:e.part,anchor:e.anchor,duration:t,place:u[n]??null,nameRef:t=>(r.current.set(e.id,t),()=>{r.current.delete(e.id)})},e.id))})}function Kt({part:e,anchor:t,duration:n,place:i,nameRef:a}){let{at:o,end:s}=t,c=(o,s)=>(0,I.jsx)(`span`,{"data-anchor":`${e}:${t.name}${o?`:end`:``}`,"data-time":s.toFixed(4),title:t.name,className:`before:bg-foreground/70 absolute inset-y-0 z-10 -ml-1 w-2 before:absolute before:inset-y-0 before:left-1/2 before:w-px`,style:{left:Q(s,n)},children:!o&&(0,I.jsx)(`span`,{ref:a,"data-anchor-lane":i?String(i.lane):void 0,className:r(`bg-background text-muted-foreground absolute rounded-xs px-0.5 font-mono text-micro leading-3 whitespace-nowrap`,i?.side===`before`?`right-1/2 mr-px`:`left-1/2 ml-px`,!i&&`invisible`),style:{bottom:`${String((i?.lane??0)*Wt)}rem`},children:t.name})},o?`end`:`at`);return(0,I.jsxs)(I.Fragment,{children:[s!==void 0&&s>o&&(0,I.jsx)(`span`,{className:`bg-foreground/50 pointer-events-none absolute bottom-0 z-10 h-px`,style:{left:Q(o,n),width:Q(s-o,n)}}),c(!1,o),s!==void 0&&c(!0,s)]})}function qt({music:e,duration:t,ducked:n}){let{start:i,end:a}=e,o=(0,F.useCallback)(t=>{let n=kt(e,t);return n===void 0?void 0:{at:n,gain:At(e,t)}},[e]),s=We(e.file);return(0,I.jsx)(Lt,{mono:!0,title:s,time:`${Y(i)} – ${Y(a)}`,line:e.ducked.length?n:void 0,children:(0,I.jsxs)(`div`,{"data-music":s,className:r(Vt,`bg-track-music/15 border-track-music/60`),style:{left:Q(i,t),width:Q(a-i,t)},children:[(0,I.jsx)(zt,{file:e.file,from:i,to:a,sample:o,alpha:.6,className:`text-track-music`}),(0,I.jsx)(`span`,{className:`bg-background/85 text-foreground absolute top-1/2 left-1.5 -translate-y-1/2 rounded-xs px-1 font-mono text-micro leading-[14px]`,children:s})]})})}var Jt=(0,F.memo)(function({timeline:e,texts:t,tracks:n,rows:i,current:a,second:o,onSeek:s}){let c=X(),{duration:l,parts:u}=e,d=e=>(0,I.jsx)(`span`,{className:`text-muted-foreground bg-background pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 px-1 text-xs leading-4`,children:e}),f=n.speech,p=n.music?[n.music]:[],m=n.cues,h=e=>u.find(t=>t.key===e)?.title??e;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`relative border-t`,style:{height:Z.scenes+1},"data-row":`scenes`,children:u.map((e,n)=>{let i=e.key===a,c=e.title??e.key,u=t.find(t=>t.key===e.key),d=u?.spoken??Ft(u?.onScreen??[],c),f=(e.end-e.start)*o<56;return(0,I.jsx)(Lt,{title:(0,I.jsx)(`span`,{className:`font-serif text-dense`,children:c}),time:`${Y(e.start)} – ${Y(e.end)}`,line:d||void 0,children:(0,I.jsxs)(`button`,{type:`button`,"data-chapter":e.key,"data-start":e.start.toFixed(4),"aria-current":i?`true`:void 0,className:r(Vt,`flex items-center gap-1.5 px-2 text-left transition-colors`,i?`bg-track-scene/25 border-track-scene`:`bg-track-scene/10 border-track-scene/45 hover:bg-track-scene/20`),style:{left:Q(e.start,l),width:`calc(${Q(e.end-e.start,l)} - 1px)`},onPointerDown:e=>{e.stopPropagation()},onClick:()=>{s(e.start)},children:[(0,I.jsx)(`span`,{className:r(`font-mono text-micro tabular-nums`,i?`text-foreground/70`:`text-muted-foreground`),children:String(n+1)}),f?null:(0,I.jsx)(`span`,{className:r(`min-w-0 truncate font-serif text-xs`,i?`font-semibold`:`text-foreground/80`),children:c})]})},e.key)})}),i.includes(`voice`)?(0,I.jsxs)(`div`,{className:`relative border-t`,style:{height:Z.voice+1},"data-row":`voice`,children:[f.length>0?f.map(e=>(0,I.jsx)(Ht,{line:e,duration:l,onSeek:s},`${e.part}@${String(e.start)}`)):d(c.noVoice),(0,I.jsx)(Gt,{parts:u,duration:l})]}):null,i.includes(`music`)?(0,I.jsx)(`div`,{className:`relative border-t`,style:{height:Z.music+1},"data-row":`music`,children:p.length?p.map(e=>(0,I.jsx)(qt,{music:e,duration:l,ducked:c.ducked},`${e.file}@${String(e.start)}`)):d(c.noMusic)}):null,i.includes(`sound`)?(0,I.jsxs)(`div`,{className:`relative border-t`,style:{height:Z.sound+1},"data-row":`sound`,children:[(0,I.jsx)(`span`,{className:`bg-rule-strong absolute inset-x-0 top-1/2 h-px`}),m.length?m.map((e,t)=>(0,I.jsx)(Lt,{mono:!0,title:e.sound,time:`${Y(e.t)} · ${h(e.part)}`,line:e.what,children:(0,I.jsx)(`span`,{"data-cue":e.sound,className:`absolute top-1/2 block size-[7px] -translate-y-1/2`,style:{left:Q(e.t,l)},children:(0,I.jsx)(`span`,{className:r(`bg-track-sound block size-full rotate-45`,e.t*o<5?`translate-x-[2px]`:`-translate-x-1/2`)})})},`${e.sound}@${String(e.t)}#${String(t)}`)):d(c.noCues)]}):null]})});function Yt({timeline:e,texts:t,tracks:n,rows:i,state:a,onSeek:o}){let s=X(),{duration:c,fps:l,parts:u}=e,d=Math.max(0,c-1/l),f=(0,F.useRef)(null),p=(0,F.useRef)(null),[m,h]=(0,F.useState)(0),[g,_]=(0,F.useState)(!1),[v,y]=(0,F.useState)();(0,F.useLayoutEffect)(()=>{let e=f.current;if(!e)return;let t=()=>{h(e.clientWidth)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]);let b=m>0&&m/c<Pt,x=b?Math.ceil(c*Pt):m,S=x/Math.max(c,1e-6),{t:C,playing:w}=a;(0,F.useEffect)(()=>{let e=p.current;if(!e)return;let t=t=>{let n=Math.min(Math.max(t,0),c)*S;e.style.transform=`translateX(${String(n)}px)`;let r=f.current;b&&w&&r&&(n<r.scrollLeft+24||n>r.scrollLeft+r.clientWidth-24)&&(r.scrollLeft=Math.max(0,n-r.clientWidth*.2))};if(t(C),!w)return;let n=performance.now(),r=requestAnimationFrame(function e(i){t(Math.min(C+(i-n)/1e3,d)),r=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(r)}},[C,w,S,c,d,b]);let T=e=>{let t=e.currentTarget.getBoundingClientRect(),n=Math.min(t.width,Math.max(0,e.clientX-t.left))/Math.max(t.width,1)*c;return Math.min(Math.max(Ue(n,l),0),d)},E=e=>{o(Math.min(Math.max(Ue(e,l),0),d))},D=u.find(e=>a.t>=e.start&&a.t<e.end)??u.at(-1),{minor:O,major:k}=It(c),A=[];for(let e=0;e<=c+1e-6;e+=O)A.push(e);let j=(e,t)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 overflow-hidden border-t pr-2 pl-3 max-[559px]:justify-center max-[559px]:px-0`,style:{height:Z[e]+1},"data-track":e,children:[(0,I.jsx)(`span`,{role:`img`,"aria-label":s.rows[e],className:r(`shrink-0 [&_svg]:size-3.5`,Mt[e]),children:t}),(0,I.jsx)(ze,{"aria-hidden":!0,className:`text-micro whitespace-nowrap max-[559px]:hidden`,children:s.rows[e]})]});return(0,I.jsx)(ht,{delayDuration:250,children:(0,I.jsxs)(`div`,{className:`flex border-t`,style:{height:Nt(i)+1},"data-testid":`timeline`,children:[(0,I.jsxs)(`div`,{className:`w-max min-w-20 shrink-0 border-r max-[559px]:w-10 max-[559px]:min-w-10`,children:[(0,I.jsx)(`div`,{style:{height:Z.ruler}}),j(`scenes`,(0,I.jsx)(de,{})),i.includes(`voice`)?j(`voice`,(0,I.jsx)(pe,{})):null,i.includes(`music`)?j(`music`,(0,I.jsx)(P,{})):null,i.includes(`sound`)?j(`sound`,(0,I.jsx)(fe,{})):null]}),(0,I.jsx)(`div`,{ref:f,className:r(`relative min-w-0 flex-1 overflow-y-hidden border-l border-transparent`,b?`overflow-x-auto`:`overflow-x-hidden`),"data-testid":`tracks`,children:(0,I.jsxs)(`div`,{className:`relative h-full cursor-pointer touch-none`,style:{width:x||`100%`},onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),_(!0),o(T(e))},onPointerMove:e=>{let t=T(e);y(t),g&&o(t)},onPointerUp:()=>{_(!1)},onPointerCancel:()=>{_(!1)},onPointerLeave:()=>{y(void 0)},children:[(0,I.jsx)(`div`,{role:`slider`,tabIndex:0,"aria-label":s.seek,"aria-valuemin":0,"aria-valuemax":Math.round(c*100)/100,"aria-valuenow":Math.round(a.t*100)/100,"aria-valuetext":s.timeOf(J(a.t),J(c),D?.title??``),"data-testid":`scrubber`,className:`focus-visible:outline-ring relative outline-none focus-visible:outline-1 focus-visible:outline-solid focus-visible:-outline-offset-1`,style:{height:Z.ruler},onKeyDown:e=>{if(e.key===`ArrowLeft`)E(a.t-1);else if(e.key===`ArrowRight`)E(a.t+1);else if(e.key===`Home`)E(0);else if(e.key===`End`)E(d);else return;e.preventDefault()},children:A.map(e=>{let t=Math.abs(e/k-Math.round(e/k))<1e-6;return(0,I.jsxs)(`span`,{className:`absolute bottom-0`,style:{left:Q(e,c)},children:[(0,I.jsx)(`span`,{className:r(`absolute bottom-0 left-0 w-px`,t?`bg-lead-soft h-2`:`bg-rule-strong h-1`)}),t&&(c-e)*S>34?(0,I.jsx)(`span`,{className:`text-muted-foreground absolute bottom-[7px] left-1 font-mono text-micro leading-none tabular-nums`,children:J(e)}):null]},e)})}),(0,I.jsx)(Jt,{timeline:e,texts:t,tracks:n,rows:i,current:a.part??D?.key,second:S,onSeek:o}),v===void 0?null:(0,I.jsxs)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-y-0 left-0 z-10`,style:{transform:`translateX(${String(v*S)}px)`},"data-testid":`hover-guide`,children:[(0,I.jsx)(`span`,{className:`bg-foreground/25 absolute inset-y-0 left-0 w-px`}),(0,I.jsx)(`span`,{className:`bg-popover text-popover-foreground absolute top-0.5 left-1 rounded-xs border px-1 font-mono text-micro leading-[14px] tabular-nums`,children:J(v)})]}),(0,I.jsxs)(`div`,{ref:p,"aria-hidden":!0,className:`pointer-events-none absolute inset-y-0 left-0 z-20 will-change-transform`,"data-testid":`playhead`,children:[(0,I.jsx)(`span`,{className:`bg-foreground absolute inset-y-0 left-0 w-px`}),(0,I.jsx)(`svg`,{viewBox:`0 0 9 9`,className:`text-foreground absolute top-0 -left-1 size-[9px]`,children:(0,I.jsx)(`path`,{d:`M0 0h9v4L4.5 9 0 4z`,fill:`currentColor`})})]})]})})]})})}var Xt=48,Zt=[`voice`,`music`,`sound`],Qt=[`voice`],$t=[],en=160,tn=560,nn=1e3,rn=20,an=1500,on=15e3,sn=e=>({timeline:e.timeline,texts:e.text,tracks:Dt(e.timeline,e.text,e.mix),uncut:jt(e.timeline)});function cn({item:e,version:t,revision:n,width:i,height:a,start:o,overlay:s,onLoaded:u,onError:d,onState:f,ref:p}){let m=X(),h=C(),g=(0,F.useRef)(null),_=(0,F.useRef)(new Map),[v,y]=(0,F.useState)(),[b,x]=(0,F.useState)(),[S,T]=(0,F.useState)(),[E,O]=(0,F.useState)(),[k,A]=(0,F.useState)(!1),[j,ee]=(0,F.useState)(),M=w(j),[N,ne]=(0,F.useState)({t:o?.t??0,part:void 0,playing:!1}),[re,ie]=(0,F.useState)(0),[ae,oe]=(0,F.useState)(),[se=!0,ce]=ct(`video-editor.timeline`,!0),ue=(0,F.useRef)(null),[de,fe]=(0,F.useState)(0),pe=(0,F.useRef)(1),P=(0,F.useRef)({shown:v,pending:b,play:N,view:S,onLoaded:u,onError:d,onState:f});(0,F.useEffect)(()=>{P.current={shown:v,pending:b,play:N,view:S,onLoaded:u,onError:d,onState:f}});let me=e=>e===void 0?void 0:g.current?.querySelector(`iframe[data-frame="${String(e.id)}"]`)?.contentWindow,L=e=>{mt(me(P.current.shown),e)};(0,F.useImperativeHandle)(p,()=>({seek:e=>{L({type:`seek`,t:e})},play:()=>{L({type:`play`})},pause:()=>{L({type:`pause`})}}));let R=n=>c(h,`video/stage`,{item:e,version:t,start:n,chrome:!1}).then(e=>(ee(e.probe),e.url)),ge=`${e}\n${t}`,_e=(0,F.useRef)(e);(0,F.useEffect)(()=>{let{shown:t,play:n}=P.current,r=_e.current===e;_e.current=e;let i={t:0},a=t?r?{t:n.t}:i:o??i,s=!0;return R(a).then(e=>{s&&(y({id:pe.current++,src:e}),x(void 0),O(void 0))},e=>{if(!s)return;let t=e instanceof Error?e.message:String(e);O(t),P.current.onError?.(t)}),()=>{s=!1}},[ge]);let z=(0,F.useRef)(n);(0,F.useEffect)(()=>{if(n===z.current)return;z.current=n;let{shown:e,play:t,view:r}=P.current;if(!e)return;let i=r?.timeline.parts.find(e=>t.t>=e.start&&t.t<e.end),a=i?{t:t.t,part:i.key,offset:t.t-i.start,dur:i.end-i.start}:{t:t.t},o=!0;return R(a).then(e=>{o&&x({id:pe.current++,src:e,from:t.t})},e=>{o&&P.current.onError?.(e instanceof Error?e.message:String(e))}),()=>{o=!1}},[n]),(0,F.useEffect)(()=>{if(!b)return;let e=setTimeout(()=>{x(void 0),P.current.onError?.(m.loadFailed)},on);return()=>{clearTimeout(e)}},[b,m.loadFailed]),(0,F.useEffect)(()=>{let e=e=>{let t=pt(e.data);if(!t)return;let{shown:n,pending:r}=P.current,i=[n,r].find(t=>t!==void 0&&me(t)===e.source);if(!i)return;let a=i.id===r?.id;if(t.type===`located`)_.current.get(t.id)?.(t.layers),_.current.delete(t.id);else if(t.type===`sound`)i.denoising=t.denoising,a||A(t.denoising);else if(t.type===`loaded`){let e={kind:t.kind,timeline:t.timeline,text:t.text,reads:t.reads,problems:t.problems,mix:t.mix};if(a){i.loaded=e;return}T(sn(e)),O(void 0),P.current.onLoaded?.(e)}else if(t.type===`error`)a?x(void 0):O(t.message),P.current.onError?.(t.message);else if(t.type===`time`){if(a){if(!i.loaded)return;y(i),x(void 0),ie(e=>e+1),A(i.denoising===!0),T(sn(i.loaded)),O(void 0),P.current.onLoaded?.(i.loaded);let t=P.current.play.t;if(i.from!==void 0&&Math.abs(t-i.from)>1e-6){mt(e.source,{type:`seek`,t});return}}let n={t:t.t,part:t.part,playing:t.playing};oe(i.id),ne(n),P.current.onState?.(n)}};return window.addEventListener(`message`,e),()=>{window.removeEventListener(`message`,e)}},[]);let B=S?.timeline,[ve,V]=B?[B.width,B.height]:[i,a],ye=S?.uncut.find(e=>e.part===N.part);(0,F.useLayoutEffect)(()=>{let e=ue.current;if(!e)return;let t=()=>{fe(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]);let H=B!==void 0,be=N.playing;(0,F.useEffect)(()=>{if(!H)return;let e=e=>{if(e.key!==` `||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;t instanceof HTMLElement&&(t.isContentEditable||t.closest(`input,textarea,select,button,a,[role=slider],[role=menuitem],[role=dialog]`))||(e.preventDefault(),mt(me(P.current.shown),{type:be?`pause`:`play`}))};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[H,be]);let U=e=>{L({type:`seek`,t:e})},xe=(e,t)=>(0,I.jsx)(`iframe`,{"data-frame":e.id,src:e.src,title:m.previewTitle,...M?{sandbox:`allow-scripts`}:{},allow:`autoplay`,"data-testid":t?`stage-pending`:`stage`,className:r(`absolute -inset-0.5 size-[calc(100%+4px)] border-0`,t&&`pointer-events-none opacity-0`)},e.id),W=B?`bg-background`:`bg-black`,Se=(0,I.jsxs)(I.Fragment,{children:[v&&M!==void 0?xe(v,!1):null,b&&M!==void 0?xe(b,!0):null,B||E!==void 0?null:(0,I.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,I.jsx)(Be,{label:m.loading,className:`[&>span]:bg-on-media/80`})}),k?(0,I.jsx)(`span`,{className:`bg-background/90 text-muted-foreground absolute top-2 right-2 rounded-sm px-2 py-0.5 font-mono text-micro`,"data-testid":`denoising`,children:m.denoising}):null,B?(0,I.jsx)(`span`,{"aria-hidden":!0,"data-testid":`play-affordance`,"data-shown":!N.playing&&N.t<.05?``:void 0,className:`bg-foreground/92 text-background pointer-events-none absolute top-1/2 left-1/2 flex size-14 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md opacity-0 transition-opacity data-[shown]:opacity-100`,children:(0,I.jsx)(he,{className:`size-6 translate-x-px fill-current`})}):null,ye?(0,I.jsx)(`span`,{className:`bg-background/90 text-muted-foreground absolute top-2 left-2 max-w-[calc(100%-1rem)] rounded-sm px-2 py-0.5 font-mono text-micro`,"data-testid":`uncut`,children:m.uncut(ye.file)}):null,s]}),Ce=ae!==void 0&&ae===v?.id,we=async()=>{L({type:`pause`});let e=Date.now()+nn;for(;P.current.play.playing&&Date.now()<e;)await new Promise(e=>{setTimeout(e,rn)})},Te=e=>{let t=g.current?.getBoundingClientRect();if(!t||t.width===0||t.height===0)return Promise.resolve([]);let n=crypto.randomUUID();return new Promise(r=>{let i=setTimeout(()=>{_.current.delete(n),r([])},an);_.current.set(n,e=>{clearTimeout(i),r(e)}),L({type:`locate`,id:n,mark:le(e,({x:e,y:n})=>({x:(e-t.x)/t.width,y:(n-t.y)/t.height}))})})},G=D()?.item.entry;l({freeze:async()=>{await we();let{t:n,part:r}=P.current.play;return{key:`${e}@${t}@${n.toFixed(3)}@${String(P.current.shown?.id??0)}`,what:`The video ${e}, version ${t}, at ${n.toFixed(2)} s${r===void 0?``:`, in the part ${r}`}`,...G===void 0?{}:{source:{path:G}}}},pictures:async()=>{let n=g.current?.getBoundingClientRect();if(!n)return[];let r=await c(h,`video/still`,{item:e,version:t,t:P.current.play.t}).catch(()=>void 0);return r?[{rect:{x:n.x,y:n.y,width:n.width,height:n.height},mime:r.image.mime,data:r.image.data}]:[]},locate:async e=>{let t=g.current?.getBoundingClientRect();return t&&te(e,t)?(await Te(e)).map(e=>({name:`${e.name===void 0?`the ${e.layer} layer`:`layer ${JSON.stringify(e.name)}`} of part ${e.part}`,...G===void 0?{}:{source:{path:G}},...e.text===void 0?{}:{text:e.text}})):[...document.querySelectorAll(`[data-row]`)].filter(t=>te(e,t.getBoundingClientRect())).map(e=>({name:`the ${e.dataset.row??``} row of the timeline`}))}});let Ee=e=>de-Xt-3-Nt(e)-1,De=[Zt,Qt].find(e=>Ee(e)>=en)??$t,K=B&&se?Nt(De)+1:0,Oe=51+K,q=`min(100cqw - 2px, (100cqh - ${String(Oe)}px) * ${String(ve/V)})`,ke=K?`max(${q}, min(100cqw - 2px, ${String(tn)}px))`:q;return(0,I.jsx)(`div`,{className:`flex h-full min-h-0 flex-col gap-2`,"data-testid":`video-preview`,"data-t":N.t.toFixed(4),"data-ready":Ce?``:void 0,"data-swaps":re,children:(0,I.jsx)(`div`,{ref:ue,className:`flex min-h-0 flex-1 flex-col items-center justify-start [container-type:size]`,children:(0,I.jsxs)(`div`,{className:`box-content overflow-hidden border`,style:{width:ke},"data-testid":`player`,children:[(0,I.jsx)(`div`,{ref:g,className:r(`relative mx-auto overflow-hidden`,W),style:{width:q,height:`calc(${q} * ${String(V/ve)})`},children:Se}),B?(0,I.jsx)(ln,{timeline:B,state:N,open:se,onOpen:ce,onToggle:()=>{L({type:N.playing?`pause`:`play`})},onSeek:U}):(0,I.jsx)(`div`,{className:`h-12 border-t`}),B&&se?(0,I.jsx)(Yt,{timeline:B,texts:S.texts,tracks:S.tracks,rows:De,state:N,onSeek:U}):null]})})})}var $=2;function ln({timeline:e,state:t,open:n,onOpen:r,onToggle:i,onSeek:a}){let o=X(),{parts:s}=e,c=Math.max(0,s.findIndex((e,n)=>n===s.length-1||t.t<e.end)),l=s[c];return(0,I.jsxs)(`div`,{className:`relative flex h-12 items-center gap-3 border-t px-3`,"data-testid":`transport`,children:[(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{size:`icon-sm`,className:`rounded-md`,"aria-label":t.playing?o.pause:o.play,"data-testid":`play`,onClick:i,children:t.playing?(0,I.jsx)(me,{className:`fill-current`}):(0,I.jsx)(he,{className:`translate-x-px fill-current`})}),(0,I.jsxs)(`span`,{className:`shrink-0 font-mono text-xs tabular-nums`,"data-testid":`clock`,children:[J(Math.min(t.t,e.duration)),(0,I.jsxs)(`span`,{className:`text-muted-foreground`,children:[` / `,J(e.duration)]})]})]}),n?(0,I.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:l?(0,I.jsxs)(`span`,{className:`text-muted-foreground max-w-[40%] truncate font-mono text-micro`,"data-testid":`scene-now`,children:[String(c+1),` · `,l.title??l.key]}):null}):(0,I.jsx)(un,{timeline:e,state:t,onSeek:a}),(0,I.jsx)(k,{size:`icon-sm`,variant:`ghost`,className:`text-muted-foreground -mr-1`,"aria-label":n?o.hideTimeline:o.showTimeline,title:n?o.hideTimeline:o.showTimeline,"aria-expanded":n,"data-testid":`timeline-toggle`,onClick:()=>{r(!n)},children:n?(0,I.jsx)(ue,{}):(0,I.jsx)(N,{})})]})}function un({timeline:e,state:t,onSeek:n}){let r=X(),{duration:i,fps:a}=e,o=Math.max(0,i-1/a),s=e.parts.length?e.parts.map((e,t)=>({key:e.key,name:e.title??String(t+1),start:e.start,end:e.end})):[{key:``,name:``,start:0,end:i}],c=(s.length-1)*$,[l,u]=(0,F.useState)(),[d,f]=(0,F.useState)(),p=Math.min(l??t.t,i),m=e=>Math.max(0,s.findIndex((t,n)=>n===s.length-1||e<t.end)),h=s[m(p)],g=e=>{let t=e.currentTarget.getBoundingClientRect(),n=Math.min(t.width,Math.max(0,e.clientX-t.left)),r=Math.max(1,t.width-c),l=0,u=i;for(let e of s){let t=r*(e.end-e.start)/Math.max(i,1e-6);if(n<=l+t+$/2){let r=Math.min(1,Math.max(0,(n-l)/Math.max(t,1)));u=e.start+r*(e.end-e.start);break}l+=t+$}return{x:n,t:Math.min(Math.max(Ue(u,a),0),o)}},_=e=>{n(Math.min(Math.max(Ue(e,a),0),o))},v=d?s[m(d.t)]?.name:void 0;return(0,I.jsxs)(`div`,{role:`slider`,tabIndex:0,"aria-label":r.seek,"aria-valuemin":0,"aria-valuemax":Math.round(i*100)/100,"aria-valuenow":Math.round(p*100)/100,"aria-valuetext":r.timeOf(J(p),J(i),h?.name??``),"data-testid":`scrubber`,className:`group/scrub focus-visible:outline-ring relative h-6 min-w-0 flex-1 cursor-pointer touch-none rounded-sm outline-none focus-visible:outline-1 focus-visible:outline-solid focus-visible:-outline-offset-1`,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId);let t=g(e);u(t.t),f(t),n(t.t)},onPointerMove:e=>{let t=g(e);f(t),l!==void 0&&t.t!==l&&(u(t.t),n(t.t))},onPointerUp:()=>{u(void 0)},onPointerCancel:()=>{u(void 0)},onPointerLeave:()=>{f(void 0)},onKeyDown:e=>{if(e.key===`ArrowLeft`)_(t.t-1);else if(e.key===`ArrowRight`)_(t.t+1);else if(e.key===`Home`)_(0);else if(e.key===`End`)_(o);else return;e.preventDefault()},children:[(0,I.jsx)(`div`,{className:`absolute inset-x-0 top-1/2 flex h-1 -translate-y-1/2 transition-[height] duration-100 group-hover/scrub:h-1.5`,style:{gap:$},children:s.map(e=>{let t=Math.max(e.end-e.start,1e-6),n=Math.min(1,Math.max(0,(p-e.start)/t));return(0,I.jsx)(`span`,{"data-chapter":e.key,className:`bg-rule-strong relative min-w-0 overflow-hidden`,style:{flexGrow:t,flexBasis:0},children:(0,I.jsx)(`span`,{className:`bg-foreground absolute inset-y-0 left-0`,style:{width:`${String(n*100)}%`}})},e.key)})}),(0,I.jsx)(`span`,{"aria-hidden":!0,className:`bg-foreground ring-background pointer-events-none absolute top-1/2 h-3 w-[3px] -translate-x-1/2 -translate-y-1/2 ring-1`,style:{left:`calc((100% - ${String(c)}px) * ${String(p/Math.max(i,1e-6))} + ${String(m(p)*$)}px)`}}),d?(0,I.jsxs)(`span`,{role:`tooltip`,"data-testid":`scrub-tip`,className:`bg-popover text-popover-foreground shadow-overlay pointer-events-none absolute bottom-full z-10 mb-1.5 flex max-w-[16rem] -translate-x-1/2 items-baseline gap-2 rounded-sm px-2 py-1 whitespace-nowrap`,style:{left:d.x},children:[v?(0,I.jsx)(`span`,{className:`truncate font-serif text-dense`,children:v}):null,(0,I.jsx)(`span`,{className:`text-muted-foreground font-mono text-micro tabular-nums`,children:J(d.t)})]}):null]})}var dn={error:0,warn:1};function fn(e){let t=new Set;return[...e].sort((e,t)=>dn[e.level]-dn[t.level]).filter(e=>{let n=`${e.code}\u0000${e.message}\u0000${e.where?.file??``}`;return!t.has(n)&&(t.add(n),!0)})}function pn({error:e,problems:t,compact:n}){let o=X(),[s,c]=(0,F.useState)(!1),l=fn(t);return e===void 0?l.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`bg-background/90 text-foreground absolute bottom-2 left-2 z-20 flex items-center gap-1.5 rounded-sm px-2 py-1 font-mono text-micro`,onClick:()=>{c(!s)},"aria-expanded":s,"data-testid":`problems-chip`,children:[(0,I.jsx)(i,{className:r(`size-3.5`,l.some(e=>e.level===`error`)?`text-problem-text`:`text-caution-text`)}),o.problemsHere(l.length)]}),s?(0,I.jsxs)(`div`,{className:`bg-card absolute bottom-10 left-2 z-30 flex max-h-[60%] w-[min(420px,calc(100%-1rem))] flex-col rounded-md border shadow-[var(--allyhub-shadow-overlay)]`,"data-testid":`problems`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-end border-b px-1 py-1`,children:(0,I.jsx)(k,{size:`icon-xs`,variant:`ghost`,"aria-label":o.close,onClick:()=>{c(!1)},children:(0,I.jsx)(a,{})})}),(0,I.jsx)(`ul`,{className:`divide-y overflow-y-auto`,children:l.map((e,t)=>(0,I.jsxs)(`li`,{"data-code":e.code,className:`px-3 py-2 text-sm leading-relaxed`,children:[(0,I.jsxs)(`span`,{className:`text-muted-foreground mr-2 font-mono text-micro`,children:[e.level===`error`?o.levelError:o.levelWarn,` ·`,` `,e.code]}),e.message]},`${e.code}-${String(t)}`))})]}):null]}):null:(0,I.jsx)(`div`,{className:r(`z-20 overflow-auto text-left`,n?`bg-background/94 absolute inset-x-0 bottom-0 max-h-[45%] border-t px-4 py-3`:`bg-background/96 absolute inset-0 grid content-center justify-items-center p-5 text-center`),"data-testid":`stage-overlay`,"data-compact":n?`true`:void 0,role:`alert`,children:(0,I.jsxs)(`p`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,I.jsx)(i,{className:`text-problem-text size-4`,"aria-hidden":!0}),n?o.previewFailedKept:o.previewFailed]})})}var mn=1200;function hn({item:e,piece:t,version:n,revision:r,problems:i}){let[a,o]=(0,F.useState)(),[s,c]=(0,F.useState)(),[l,u]=(0,F.useState)();(0,F.useEffect)(()=>{if(s===void 0)return;let e=setTimeout(()=>{u(s)},mn);return()=>{clearTimeout(e)}},[s]);let d=s!==void 0&&l===s?s:void 0,[f,p]=(0,F.useState)(n.key);f!==n.key&&(p(n.key),o(void 0),c(void 0));let m=[...i,...a?.problems??[]];return(0,I.jsx)(`div`,{className:`bg-paper size-full p-4 min-[560px]:p-6`,children:(0,I.jsx)(cn,{item:e,version:n.key,revision:r,width:t.width,height:t.height,overlay:(0,I.jsx)(pn,{error:d,problems:m,compact:a!==void 0}),onLoaded:e=>{o(e),c(void 0)},onError:c})})}function gn(e,t,n){let r=t.versions.filter(e=>n?.includes(e.key)!==!1).flatMap(n=>dt(e,t.piece,n)).filter(e=>e.level===`error`).map(e=>`${e.code}: ${e.message}`);return new Set(r).size}function _n(){let e=X(),t=D(),r=t?.item.dir,i=n[o(t?.locale)],a=ot(),{data:s,error:c}=at(`video/versions`,r===void 0?void 0:{item:r},[a]),[l,u]=ct(`video-editor.version:${r??``}`,``),d=st(),f=s?ut(s,l):void 0,{data:p}=at(`video/timeline`,r===void 0||!f?void 0:{item:r,version:f.key},[a]);if(r===void 0||!s&&!c)return(0,I.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,I.jsx)(Be,{label:e.loading})});if(!s||!f)return(0,I.jsx)(Ve,{title:e.noVideo,className:`h-full justify-center`,children:c?.message});let m=d?dt(d.problems,s.piece,f):[],h=e=>e.lang===void 0?e.key:ft(e.lang,i),g=s.kind===`video`?p?.timeline:void 0,_=s.kind===`video`&&p!==void 0&&!p.text.some(e=>e.spoken!==void 0);return(0,I.jsxs)(`div`,{className:`flex size-full min-h-0 flex-col`,"data-testid":`video-editor`,children:[(0,I.jsx)(se,{start:s.versions.length>1?(0,I.jsxs)(ne,{value:f.key,onValueChange:e=>{u(e)},children:[(0,I.jsx)(ce,{"aria-label":e.version,className:`max-w-[16rem]`,"data-testid":`version`,children:(0,I.jsx)(ae,{})}),(0,I.jsx)(re,{position:`popper`,align:`start`,children:s.versions.map(e=>(0,I.jsx)(oe,{value:e.key,className:`text-xs`,title:e.key,children:h(e)},e.key))})]}):void 0,exports:{versions:s.versions.map(e=>({key:e.key,label:h(e)})),shown:f.key,facts:[`${String(s.width)} × ${String(s.height)}`,...g?[`${String(g.fps)} fps`,J(g.duration)]:[]].join(` · `),unavailable:_?{srt:e.noVoice}:{},check:{waiting:d?.status===`waiting`||d?.status===`running`,problems:e=>d?.status===`done`?gn(d.problems,s,e):0}}}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,I.jsx)(hn,{item:r,piece:s,version:f,revision:a,problems:m})})]})}var vn=e({VideoEditor:()=>_n});export{ut as a,ct as c,Be as d,he as f,ft as i,at as l,gn as n,st as o,pt as r,ot as s,vn as t,Ve as u};
|