officialblock 2.5.8 → 2.5.9
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/{index-O7n8ZtSr.js → index-3ya_TFAt.js} +1 -1
- package/dist/{index-CoOc1vYJ.js → index-BmKv7unv.js} +1 -1
- package/dist/{index-CuXYQuxj.mjs → index-CYZx5Lrb.mjs} +1 -1
- package/dist/index-Cd2POWPg.mjs +4 -0
- package/dist/{index-BzDhyKII.mjs → index-D1iJ8-En.mjs} +35 -30
- package/dist/{index-CG6OeM1h.js → index-DeWnfKn3.js} +5 -5
- package/dist/official-block.cjs.js +1 -1
- package/dist/official-block.es.js +1 -1
- package/dist/official-block.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index-BTz--VNe.mjs +0 -4
|
@@ -530,4 +530,4 @@ ${sl(t)}`),o.map&&!o.map.bytes&&(this.logger_("going to request init segment."),
|
|
|
530
530
|
`.split("").map(n=>n.charCodeAt(0)));class oG extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class aG extends xp{constructor(t,o={}){super(t,o),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=t.featuresNativeTextTracks,this.loadVttJs=t.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return jt();const t=this.subtitlesTrack_.cues,o=t[0].startTime,a=t[t.length-1].startTime;return jt([[o,a]])}initSegmentForMap(t,o=!1){if(!t)return null;const a=_c(t);let i=this.initSegments_[a];if(o&&!i&&t.bytes){const l=O2.byteLength+t.bytes.byteLength,s=new Uint8Array(l);s.set(t.bytes),s.set(O2,t.bytes.byteLength),this.initSegments_[a]=i={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:s}}return i||t}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(t){return typeof t>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=t,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(t,o){bs(t,o,this.subtitlesTrack_)}fillBuffer_(){const t=this.chooseNextRequest_();if(t){if(this.syncController_.timestampOffsetForTimeline(t.timeline)===null){const o=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",o),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(t)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(t){for(;t&&t.segment.empty;){if(t.mediaIndex+1>=t.playlist.segments.length){t=null;break}t=this.generateSegmentInfo_({playlist:t.playlist,mediaIndex:t.mediaIndex+1,startOfSegment:t.startOfSegment+t.duration,isSyncRequest:t.isSyncRequest})}return t}stopForError(t){this.error(t),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(t,o,a){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(o.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(t){t.code===$o.TIMEOUT&&this.handleTimeout_(),t.code===$o.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(t);return}const i=this.pendingSegment_,l=a.mp4VttCues&&a.mp4VttCues.length;l&&(i.mp4VttCues=a.mp4VttCues),this.saveBandwidthRelatedStats_(i.duration,o.stats),o.key&&this.segmentKey(o.key,!0),this.state="APPENDING",this.trigger("appending");const s=i.segment;if(s.map&&(s.map.bytes=o.map.bytes),i.bytes=o.bytes,typeof K.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(t,o,a),()=>this.stopForError({message:"Error loading vtt.js"}));return}s.requested=!0;try{this.parseVTTCues_(i)}catch(r){this.stopForError({message:r.message,metadata:{errorType:ie.Error.StreamingVttParserError,error:r}});return}if(l||this.updateTimeMapping_(i,this.syncController_.timelines[i.timeline],this.playlist_),i.cues.length?i.timingInfo={start:i.cues[0].startTime,end:i.cues[i.cues.length-1].endTime}:i.timingInfo={start:i.startOfSegment,end:i.startOfSegment+i.duration},i.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}i.byteLength=i.bytes.byteLength,this.mediaSecondsLoaded+=s.duration,i.cues.forEach(r=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new K.VTTCue(r.startTime,r.endTime,r.text):r)}),RW(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(t,o){const a=t&&t.type==="vtt",i=o&&o.type==="text";a&&i&&super.handleData_(t,o)}updateTimingInfoEnd_(){}parseMp4VttCues_(t){const o=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();t.mp4VttCues.forEach(a=>{const i=a.start+o,l=a.end+o,s=new K.VTTCue(i,l,a.cueText);a.settings&&a.settings.split(" ").forEach(r=>{const c=r.split(":"),u=c[0],g=c[1];s[u]=isNaN(g)?g:Number(g)}),t.cues.push(s)})}parseVTTCues_(t){let o,a=!1;if(typeof K.WebVTT!="function")throw new oG;if(t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},t.mp4VttCues){this.parseMp4VttCues_(t);return}typeof K.TextDecoder=="function"?o=new K.TextDecoder("utf8"):(o=K.WebVTT.StringDecoder(),a=!0);const i=new K.WebVTT.Parser(K,K.vttjs,o);if(i.oncue=t.cues.push.bind(t.cues),i.ontimestampmap=s=>{t.timestampmap=s},i.onparsingerror=s=>{ie.log.warn("Error encountered when parsing cues: "+s.message)},t.segment.map){let s=t.segment.map.bytes;a&&(s=M2(s)),i.parse(s)}let l=t.bytes;a&&(l=M2(l)),i.parse(l),i.flush()}updateTimeMapping_(t,o,a){const i=t.segment;if(!o)return;if(!t.cues.length){i.empty=!0;return}const{MPEGTS:l,LOCAL:s}=t.timestampmap,c=l/qa.ONE_SECOND_IN_TS-s+o.mapping;if(t.cues.forEach(u=>{const g=u.endTime-u.startTime,m=this.handleRollover_(u.startTime+c,o.time);u.startTime=Math.max(m,0),u.endTime=Math.max(m+g,0)}),!a.syncInfo){const u=t.cues[0].startTime,g=t.cues[t.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+t.mediaIndex,time:Math.min(u,g-i.duration)}}}handleRollover_(t,o){if(o===null)return t;let a=t*qa.ONE_SECOND_IN_TS;const i=o*qa.ONE_SECOND_IN_TS;let l;for(i<a?l=-8589934592:l=8589934592;Math.abs(a-i)>4294967296;)a+=l;return a/qa.ONE_SECOND_IN_TS}}const iG=function(n,t){const o=n.cues;for(let a=0;a<o.length;a++){const i=o[a];if(t>=i.adStartTime&&t<=i.adEndTime)return i}return null},lG=function(n,t,o=0){if(!n.segments)return;let a=o,i;for(let l=0;l<n.segments.length;l++){const s=n.segments[l];if(i||(i=iG(t,a+s.duration/2)),i){if("cueIn"in s){i.endTime=a,i.adEndTime=a,a+=s.duration,i=null;continue}if(a<i.endTime){a+=s.duration;continue}i.endTime+=s.duration}else if("cueOut"in s&&(i=new K.VTTCue(a,a+s.duration,s.cueOut),i.adStartTime=a,i.adEndTime=a+parseFloat(s.cueOut),t.addCue(i)),"cueOutCont"in s){const[r,c]=s.cueOutCont.split("/").map(parseFloat);i=new K.VTTCue(a,a+s.duration,""),i.adStartTime=a-r,i.adEndTime=i.adStartTime+c,t.addCue(i)}a+=s.duration}};class U2{constructor({start:t,end:o,segmentIndex:a,partIndex:i=null,appended:l=!1}){this.start_=t,this.end_=o,this.segmentIndex_=a,this.partIndex_=i,this.appended_=l}isInRange(t){return t>=this.start&&t<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class sG{constructor(t,o=[]){this.segmentSyncInfo_=t,this.partsSyncInfo_=o}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(t=>t.resetAppendedStatus())}}class R2{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(t=>t.resetAppendStatus())}update(t,o){const{mediaSequence:a,segments:i}=t;if(this.isReliable_=this.isReliablePlaylist_(a,i),!!this.isReliable_)return this.updateStorage_(i,a,this.calculateBaseTime_(a,i,o))}getSyncInfoForTime(t){for(const{segmentSyncInfo:o,partsSyncInfo:a}of this.storage_.values())if(a.length){for(const i of a)if(i.isInRange(t))return i}else if(o.isInRange(t))return o;return null}getSyncInfoForMediaSequence(t){return this.storage_.get(t)}updateStorage_(t,o,a){const i=new Map;let l=`
|
|
531
531
|
`,s=a,r=o;this.start_=s,t.forEach((c,u)=>{const g=this.storage_.get(r),m=s,d=m+c.duration,p=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),f=new U2({start:m,end:d,appended:p,segmentIndex:u});c.syncInfo=f;let h=s;const V=(c.parts||[]).map((w,k)=>{const y=h,b=h+w.duration,C=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[k]&&g.partsSyncInfo[k].isAppended),E=new U2({start:y,end:b,appended:C,segmentIndex:u,partIndex:k});return h=b,l+=`Media Sequence: ${r}.${k} | Range: ${y} --> ${b} | Appended: ${C}
|
|
532
532
|
`,w.syncInfo=E,E});i.set(r,new sG(f,V)),l+=`${S2(c.resolvedUri)} | Media Sequence: ${r} | Range: ${m} --> ${d} | Appended: ${p}
|
|
533
|
-
`,r++,s=d}),this.end_=s,this.storage_=i,this.diagnostics_=l}calculateBaseTime_(t,o,a){if(!this.storage_.size)return 0;if(this.storage_.has(t))return this.storage_.get(t).segmentSyncInfo.start;const i=Math.min(...this.storage_.keys());if(t<i){const l=i-t;let s=this.storage_.get(i).segmentSyncInfo.start;for(let r=0;r<l;r++){const c=o[r];s-=c.duration}return s}return a}isReliablePlaylist_(t,o){return t!=null&&Array.isArray(o)&&o.length}}class F2 extends R2{constructor(t){super(),this.parent_=t}calculateBaseTime_(t,o,a){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(t);return i?i.segmentSyncInfo.start:0}return super.calculateBaseTime_(t,o,a)}}const rG=86400,Ep=[{name:"VOD",run:(n,t,o,a,i)=>o!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(n,t,o,a,i,l)=>{const s=n.getMediaSequenceSync(l);if(!s||!s.isReliable)return null;const r=s.getSyncInfoForTime(i);return r?{time:r.start,partIndex:r.partIndex,segmentIndex:r.segmentIndex}:null}},{name:"ProgramDateTime",run:(n,t,o,a,i)=>{if(!Object.keys(n.timelineToDatetimeMappings).length)return null;let l=null,s=null;const r=rp(t);i=i||0;for(let c=0;c<r.length;c++){const u=t.endList||i===0?c:r.length-(c+1),g=r[u],m=g.segment,d=n.timelineToDatetimeMappings[m.timeline];if(!d||!m.dateTimeObject)continue;let f=m.dateTimeObject.getTime()/1e3+d;if(m.parts&&typeof g.partIndex=="number")for(let V=0;V<g.partIndex;V++)f+=m.parts[V].duration;const h=Math.abs(i-f);if(s!==null&&(h===0||s<h))break;s=h,l={time:f,segmentIndex:g.segmentIndex,partIndex:g.partIndex}}return l}},{name:"Segment",run:(n,t,o,a,i)=>{let l=null,s=null;i=i||0;const r=rp(t);for(let c=0;c<r.length;c++){const u=t.endList||i===0?c:r.length-(c+1),g=r[u],m=g.segment,d=g.part&&g.part.start||m&&m.start;if(m.timeline===a&&typeof d<"u"){const p=Math.abs(i-d);if(s!==null&&s<p)break;(!l||s===null||s>=p)&&(s=p,l={time:d,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return l}},{name:"Discontinuity",run:(n,t,o,a,i)=>{let l=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length){let s=null;for(let r=0;r<t.discontinuityStarts.length;r++){const c=t.discontinuityStarts[r],u=t.discontinuitySequence+r+1,g=n.discontinuities[u];if(g){const m=Math.abs(i-g.time);if(s!==null&&s<m)break;(!l||s===null||s>=m)&&(s=m,l={time:g.time,segmentIndex:c,partIndex:null})}}}return l}},{name:"Playlist",run:(n,t,o,a,i)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class dG extends ie.EventTarget{constructor(t={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const o=new R2,a=new F2(o),i=new F2(o);this.mediaSequenceStorage_={main:o,audio:a,vtt:i},this.logger_=no("SyncController")}getMediaSequenceSync(t){return this.mediaSequenceStorage_[t]||null}getSyncPoint(t,o,a,i,l){if(o!==1/0)return Ep.find(({name:c})=>c==="VOD").run(this,t,o);const s=this.runStrategies_(t,o,a,i,l);if(!s.length)return null;for(const r of s){const{syncPoint:c,strategy:u}=r,{segmentIndex:g,time:m}=c;if(g<0)continue;const d=t.segments[g],p=m,f=p+d.duration;if(this.logger_(`Strategy: ${u}. Current time: ${i}. selected segment: ${g}. Time: [${p} -> ${f}]}`),i>=p&&i<f)return this.logger_("Found sync point with exact match: ",c),c}return this.selectSyncPoint_(s,{key:"time",value:i})}getExpiredTime(t,o){if(!t||!t.segments)return null;const a=this.runStrategies_(t,o,t.discontinuitySequence,0);if(!a.length)return null;const i=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+gs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:i.segmentIndex,endIndex:0}))}runStrategies_(t,o,a,i,l){const s=[];for(let r=0;r<Ep.length;r++){const c=Ep[r],u=c.run(this,t,o,a,i,l);u&&(u.strategy=c.name,s.push({strategy:c.name,syncPoint:u}))}return s}selectSyncPoint_(t,o){let a=t[0].syncPoint,i=Math.abs(t[0].syncPoint[o.key]-o.value),l=t[0].strategy;for(let s=1;s<t.length;s++){const r=Math.abs(t[s].syncPoint[o.key]-o.value);r<i&&(i=r,a=t[s].syncPoint,l=t[s].strategy)}return this.logger_(`syncPoint for [${o.key}: ${o.value}] chosen with strategy [${l}]: [time:${a.time}, segmentIndex:${a.segmentIndex}`+(typeof a.partIndex=="number"?`,partIndex:${a.partIndex}`:"")+"]"),a}saveExpiredSegmentInfo(t,o){const a=o.mediaSequence-t.mediaSequence;if(a>rG){ie.log.warn(`Not saving expired segment info. Media sequence gap ${a} is too large.`);return}for(let i=a-1;i>=0;i--){const l=t.segments[i];if(l&&typeof l.start<"u"){o.syncInfo={mediaSequence:t.mediaSequence+i,time:l.start},this.logger_(`playlist refresh sync: [time:${o.syncInfo.time}, mediaSequence: ${o.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(t){if(this.timelineToDatetimeMappings={},t.segments&&t.segments.length&&t.segments[0].dateTimeObject){const o=t.segments[0],a=o.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[o.timeline]=-a}}saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:o}){const a=this.calculateSegmentTimeMapping_(t,t.timingInfo,o),i=t.segment;a&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:i.start}));const l=i.dateTimeObject;i.discontinuity&&o&&l&&(this.timelineToDatetimeMappings[i.timeline]=-(l.getTime()/1e3))}timestampOffsetForTimeline(t){return typeof this.timelines[t]>"u"?null:this.timelines[t].time}mappingForTimeline(t){return typeof this.timelines[t]>"u"?null:this.timelines[t].mapping}calculateSegmentTimeMapping_(t,o,a){const i=t.segment,l=t.part;let s=this.timelines[t.timeline],r,c;if(typeof t.timestampOffset=="number")s={time:t.startOfSegment,mapping:t.startOfSegment-o.start},a&&(this.timelines[t.timeline]=s,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${t.timeline}: [time: ${s.time}] [mapping: ${s.mapping}]`)),r=t.startOfSegment,c=o.end+s.mapping;else if(s)r=o.start+s.mapping,c=o.end+s.mapping;else return!1;return l&&(l.start=r,l.end=c),(!i.start||r<i.start)&&(i.start=r),i.end=c,!0}saveDiscontinuitySyncInfo_(t){const o=t.playlist,a=t.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(o.discontinuityStarts&&o.discontinuityStarts.length)for(let i=0;i<o.discontinuityStarts.length;i++){const l=o.discontinuityStarts[i],s=o.discontinuitySequence+i+1,r=l-t.mediaIndex,c=Math.abs(r);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>c){let u;r<0?u=a.start-gs({defaultDuration:o.targetDuration,durationList:o.segments,startIndex:t.mediaIndex,endIndex:l}):u=a.end+gs({defaultDuration:o.targetDuration,durationList:o.segments,startIndex:t.mediaIndex+1,endIndex:l}),this.discontinuities[s]={time:u,accuracy:c}}}}dispose(){this.trigger("dispose"),this.off()}}class cG extends ie.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(t){this.pendingTimelineChanges_[t]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:t,from:o,to:a}){return typeof o=="number"&&typeof a=="number"&&(this.pendingTimelineChanges_[t]={type:t,from:o,to:a},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]}lastTimelineChange({type:t,from:o,to:a}){if(typeof o=="number"&&typeof a=="number"){this.lastTimelineChanges_[t]={type:t,from:o,to:a},delete this.pendingTimelineChanges_[t];const i={timelineChangeInfo:{from:o,to:a}};this.trigger({type:"timelinechange",metadata:i})}return this.lastTimelineChanges_[t]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const uG=p2(h2(function(){var n=function(){function h(){this.listeners={}}var V=h.prototype;return V.on=function(k,y){this.listeners[k]||(this.listeners[k]=[]),this.listeners[k].push(y)},V.off=function(k,y){if(!this.listeners[k])return!1;var b=this.listeners[k].indexOf(y);return this.listeners[k]=this.listeners[k].slice(0),this.listeners[k].splice(b,1),b>-1},V.trigger=function(k){var y=this.listeners[k];if(y)if(arguments.length===2)for(var b=y.length,C=0;C<b;++C)y[C].call(this,arguments[1]);else for(var E=Array.prototype.slice.call(arguments,1),x=y.length,N=0;N<x;++N)y[N].apply(this,E)},V.dispose=function(){this.listeners={}},V.pipe=function(k){this.on("data",function(y){k.push(y)})},h}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function t(h){return h.subarray(0,h.byteLength-h[h.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const o=function(){const h=[[[],[],[],[],[]],[[],[],[],[],[]]],V=h[0],w=h[1],k=V[4],y=w[4];let b,C,E;const x=[],N=[];let $,S,I,D,A,O;for(b=0;b<256;b++)N[(x[b]=b<<1^(b>>7)*283)^b]=b;for(C=E=0;!k[C];C^=$||1,E=N[E]||1)for(D=E^E<<1^E<<2^E<<3^E<<4,D=D>>8^D&255^99,k[C]=D,y[D]=C,I=x[S=x[$=x[C]]],O=I*16843009^S*65537^$*257^C*16843008,A=x[D]*257^D*16843008,b=0;b<4;b++)V[b][C]=A=A<<24^A>>>8,w[b][D]=O=O<<24^O>>>8;for(b=0;b<5;b++)V[b]=V[b].slice(0),w[b]=w[b].slice(0);return h};let a=null;class i{constructor(V){a||(a=o()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];let w,k,y;const b=this._tables[0][4],C=this._tables[1],E=V.length;let x=1;if(E!==4&&E!==6&&E!==8)throw new Error("Invalid aes key size");const N=V.slice(0),$=[];for(this._key=[N,$],w=E;w<4*E+28;w++)y=N[w-1],(w%E===0||E===8&&w%E===4)&&(y=b[y>>>24]<<24^b[y>>16&255]<<16^b[y>>8&255]<<8^b[y&255],w%E===0&&(y=y<<8^y>>>24^x<<24,x=x<<1^(x>>7)*283)),N[w]=N[w-E]^y;for(k=0;w;k++,w--)y=N[k&3?w:w-4],w<=4||k<4?$[k]=y:$[k]=C[0][b[y>>>24]]^C[1][b[y>>16&255]]^C[2][b[y>>8&255]]^C[3][b[y&255]]}decrypt(V,w,k,y,b,C){const E=this._key[1];let x=V^E[0],N=y^E[1],$=k^E[2],S=w^E[3],I,D,A;const O=E.length/4-2;let Q,X=4;const G=this._tables[1],M=G[0],q=G[1],U=G[2],R=G[3],H=G[4];for(Q=0;Q<O;Q++)I=M[x>>>24]^q[N>>16&255]^U[$>>8&255]^R[S&255]^E[X],D=M[N>>>24]^q[$>>16&255]^U[S>>8&255]^R[x&255]^E[X+1],A=M[$>>>24]^q[S>>16&255]^U[x>>8&255]^R[N&255]^E[X+2],S=M[S>>>24]^q[x>>16&255]^U[N>>8&255]^R[$&255]^E[X+3],X+=4,x=I,N=D,$=A;for(Q=0;Q<4;Q++)b[(3&-Q)+C]=H[x>>>24]<<24^H[N>>16&255]<<16^H[$>>8&255]<<8^H[S&255]^E[X++],I=x,x=N,N=$,$=S,S=I}}class l extends n{constructor(){super(n),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(V){this.jobs.push(V),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const s=function(h){return h<<24|(h&65280)<<8|(h&16711680)>>8|h>>>24},r=function(h,V,w){const k=new Int32Array(h.buffer,h.byteOffset,h.byteLength>>2),y=new i(Array.prototype.slice.call(V)),b=new Uint8Array(h.byteLength),C=new Int32Array(b.buffer);let E,x,N,$,S,I,D,A,O;for(E=w[0],x=w[1],N=w[2],$=w[3],O=0;O<k.length;O+=4)S=s(k[O]),I=s(k[O+1]),D=s(k[O+2]),A=s(k[O+3]),y.decrypt(S,I,D,A,C,O),C[O]=s(C[O]^E),C[O+1]=s(C[O+1]^x),C[O+2]=s(C[O+2]^N),C[O+3]=s(C[O+3]^$),E=S,x=I,N=D,$=A;return b};class c{constructor(V,w,k,y){const b=c.STEP,C=new Int32Array(V.buffer),E=new Uint8Array(V.byteLength);let x=0;for(this.asyncStream_=new l,this.asyncStream_.push(this.decryptChunk_(C.subarray(x,x+b),w,k,E)),x=b;x<C.length;x+=b)k=new Uint32Array([s(C[x-4]),s(C[x-3]),s(C[x-2]),s(C[x-1])]),this.asyncStream_.push(this.decryptChunk_(C.subarray(x,x+b),w,k,E));this.asyncStream_.push(function(){y(null,t(E))})}static get STEP(){return 32e3}decryptChunk_(V,w,k,y){return function(){const b=r(V,w,k);y.set(b,V.byteOffset)}}}var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g;typeof window<"u"?g=window:typeof u<"u"?g=u:typeof self<"u"?g=self:g={};var m=g,d=function(V){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(V):V&&V.buffer instanceof ArrayBuffer},p=m.BigInt||Number;p("0x1"),p("0x100"),p("0x10000"),p("0x1000000"),p("0x100000000"),p("0x10000000000"),p("0x1000000000000"),p("0x100000000000000"),p("0x10000000000000000"),function(){var h=new Uint16Array([65484]),V=new Uint8Array(h.buffer,h.byteOffset,h.byteLength);return V[0]===255?"big":V[0]===204?"little":"unknown"}();const f=function(h){const V={};return Object.keys(h).forEach(w=>{const k=h[w];d(k)?V[w]={bytes:k.buffer,byteOffset:k.byteOffset,byteLength:k.byteLength}:V[w]=k}),V};self.onmessage=function(h){const V=h.data,w=new Uint8Array(V.encrypted.bytes,V.encrypted.byteOffset,V.encrypted.byteLength),k=new Uint32Array(V.key.bytes,V.key.byteOffset,V.key.byteLength/4),y=new Uint32Array(V.iv.bytes,V.iv.byteOffset,V.iv.byteLength/4);new c(w,k,y,function(b,C){self.postMessage(f({source:V.source,decrypted:C}),[C.buffer])})}}));var mG=m2(uG);const pG=n=>{let t=n.default?"main":"alternative";return n.characteristics&&n.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},H2=(n,t)=>{n.abort(),n.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Tp=(n,t)=>{t.activePlaylistLoader=n,n.load()},hG=(n,t)=>()=>{const{segmentLoaders:{[n]:o,main:a},mediaTypes:{[n]:i}}=t,l=i.activeTrack(),s=i.getActiveGroup(),r=i.activePlaylistLoader,c=i.lastGroup_;if(!(s&&c&&s.id===c.id)&&(i.lastGroup_=s,i.lastTrack_=l,H2(o,i),!(!s||s.isMainPlaylist))){if(!s.playlistLoader){r&&a.resetEverything();return}o.resyncLoader(),Tp(s.playlistLoader,i)}},fG=(n,t)=>()=>{const{segmentLoaders:{[n]:o},mediaTypes:{[n]:a}}=t;a.lastGroup_=null,o.abort(),o.pause()},gG=(n,t)=>()=>{const{mainPlaylistLoader:o,segmentLoaders:{[n]:a,main:i},mediaTypes:{[n]:l}}=t,s=l.activeTrack(),r=l.getActiveGroup(),c=l.activePlaylistLoader,u=l.lastTrack_;if(!(u&&s&&u.id===s.id)&&(l.lastGroup_=r,l.lastTrack_=s,H2(a,l),!!r)){if(r.isMainPlaylist){if(!s||!u||s.id===u.id)return;const g=t.vhs.playlistController_,m=g.selectPlaylist();if(g.media()===m)return;l.logger_(`track change. Switching main audio from ${u.id} to ${s.id}`),o.pause(),i.resetEverything(),g.fastQualityChange_(m);return}if(n==="AUDIO"){if(!r.playlistLoader){i.setAudio(!0),i.resetEverything();return}a.setAudio(!0),i.setAudio(!1)}if(c===r.playlistLoader){Tp(r.playlistLoader,l);return}a.track&&a.track(s),a.resetEverything(),Tp(r.playlistLoader,l)}},Cc={AUDIO:(n,t)=>()=>{const{mediaTypes:{[n]:o},excludePlaylist:a}=t,i=o.activeTrack(),l=o.activeGroup(),s=(l.filter(c=>c.default)[0]||l[0]).id,r=o.tracks[s];if(i===r){a({error:{message:"Problem encountered loading the default audio track."}});return}ie.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const c in o.tracks)o.tracks[c].enabled=o.tracks[c]===r;o.onTrackChanged()},SUBTITLES:(n,t)=>()=>{const{mediaTypes:{[n]:o}}=t;ie.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const a=o.activeTrack();a&&(a.mode="disabled"),o.onTrackChanged()}},j2={AUDIO:(n,t,o)=>{if(!t)return;const{tech:a,requestOptions:i,segmentLoaders:{[n]:l}}=o;t.on("loadedmetadata",()=>{const s=t.media();l.playlist(s,i),(!a.paused()||s.endList&&a.preload()!=="none")&&l.load()}),t.on("loadedplaylist",()=>{l.playlist(t.media(),i),a.paused()||l.load()}),t.on("error",Cc[n](n,o))},SUBTITLES:(n,t,o)=>{const{tech:a,requestOptions:i,segmentLoaders:{[n]:l},mediaTypes:{[n]:s}}=o;t.on("loadedmetadata",()=>{const r=t.media();l.playlist(r,i),l.track(s.activeTrack()),(!a.paused()||r.endList&&a.preload()!=="none")&&l.load()}),t.on("loadedplaylist",()=>{l.playlist(t.media(),i),a.paused()||l.load()}),t.on("error",Cc[n](n,o))}},yG={AUDIO:(n,t)=>{const{vhs:o,sourceType:a,segmentLoaders:{[n]:i},requestOptions:l,main:{mediaGroups:s},mediaTypes:{[n]:{groups:r,tracks:c,logger_:u}},mainPlaylistLoader:g}=t,m=ys(g.main);(!s[n]||Object.keys(s[n]).length===0)&&(s[n]={main:{default:{default:!0}}},m&&(s[n].main.default.playlists=g.main.playlists));for(const d in s[n]){r[d]||(r[d]=[]);for(const p in s[n][d]){let f=s[n][d][p],h;if(m?(u(`AUDIO group '${d}' label '${p}' is a main playlist`),f.isMainPlaylist=!0,h=null):a==="vhs-json"&&f.playlists?h=new ol(f.playlists[0],o,l):f.resolvedUri?h=new ol(f.resolvedUri,o,l):f.playlists&&a==="dash"?h=new yp(f.playlists[0],o,l,g):h=null,f=at({id:p,playlistLoader:h},f),j2[n](n,f.playlistLoader,t),r[d].push(f),typeof c[p]>"u"){const V=new ie.AudioTrack({id:p,kind:pG(f),enabled:!1,language:f.language,default:f.default,label:p});c[p]=V}}}i.on("error",Cc[n](n,t))},SUBTITLES:(n,t)=>{const{tech:o,vhs:a,sourceType:i,segmentLoaders:{[n]:l},requestOptions:s,main:{mediaGroups:r},mediaTypes:{[n]:{groups:c,tracks:u}},mainPlaylistLoader:g}=t;for(const m in r[n]){c[m]||(c[m]=[]);for(const d in r[n][m]){if(!a.options_.useForcedSubtitles&&r[n][m][d].forced)continue;let p=r[n][m][d],f;if(i==="hls")f=new ol(p.resolvedUri,a,s);else if(i==="dash"){if(!p.playlists.filter(V=>V.excludeUntil!==1/0).length)return;f=new yp(p.playlists[0],a,s,g)}else i==="vhs-json"&&(f=new ol(p.playlists?p.playlists[0]:p.resolvedUri,a,s));if(p=at({id:d,playlistLoader:f},p),j2[n](n,p.playlistLoader,t),c[m].push(p),typeof u[d]>"u"){const h=o.addRemoteTextTrack({id:d,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:d},!1).track;u[d]=h}}}l.on("error",Cc[n](n,t))},"CLOSED-CAPTIONS":(n,t)=>{const{tech:o,main:{mediaGroups:a},mediaTypes:{[n]:{groups:i,tracks:l}}}=t;for(const s in a[n]){i[s]||(i[s]=[]);for(const r in a[n][s]){const c=a[n][s][r];if(!/^(?:CC|SERVICE)/.test(c.instreamId))continue;const u=o.options_.vhs&&o.options_.vhs.captionServices||{};let g={label:r,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(u[g.instreamId]&&(g=at(g,u[g.instreamId])),g.default===void 0&&delete g.default,i[s].push(at({id:r},c)),typeof l[r]>"u"){const m=o.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;l[r]=m}}}}},z2=(n,t)=>{for(let o=0;o<n.length;o++)if(up(t,n[o])||n[o].playlists&&z2(n[o].playlists,t))return!0;return!1},_G=(n,t)=>o=>{const{mainPlaylistLoader:a,mediaTypes:{[n]:{groups:i}}}=t,l=a.media();if(!l)return null;let s=null;l.attributes[n]&&(s=i[l.attributes[n]]);const r=Object.keys(i);if(!s)if(n==="AUDIO"&&r.length>1&&ys(t.main))for(let c=0;c<r.length;c++){const u=i[r[c]];if(z2(u,l)){s=u;break}}else i.main?s=i.main:r.length===1&&(s=i[r[0]]);return typeof o>"u"?s:o===null||!s?null:s.filter(c=>c.id===o.id)[0]||null},wG={AUDIO:(n,t)=>()=>{const{mediaTypes:{[n]:{tracks:o}}}=t;for(const a in o)if(o[a].enabled)return o[a];return null},SUBTITLES:(n,t)=>()=>{const{mediaTypes:{[n]:{tracks:o}}}=t;for(const a in o)if(o[a].mode==="showing"||o[a].mode==="hidden")return o[a];return null}},bG=(n,{mediaTypes:t})=>()=>{const o=t[n].activeTrack();return o?t[n].activeGroup(o):null},CG=n=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{yG[u](u,n)});const{mediaTypes:t,mainPlaylistLoader:o,tech:a,vhs:i,segmentLoaders:{["AUDIO"]:l,main:s}}=n;["AUDIO","SUBTITLES"].forEach(u=>{t[u].activeGroup=_G(u,n),t[u].activeTrack=wG[u](u,n),t[u].onGroupChanged=hG(u,n),t[u].onGroupChanging=fG(u,n),t[u].onTrackChanged=gG(u,n),t[u].getActiveGroup=bG(u,n)});const r=t.AUDIO.activeGroup();if(r){const u=(r.filter(m=>m.default)[0]||r[0]).id;t.AUDIO.tracks[u].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(s.setAudio(!1),l.setAudio(!0)):s.setAudio(!0)}o.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(u=>t[u].onGroupChanged())}),o.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(u=>t[u].onGroupChanging())});const c=()=>{t.AUDIO.onTrackChanged(),a.trigger({type:"usage",name:"vhs-audio-change"})};a.audioTracks().addEventListener("change",c),a.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",()=>{a.audioTracks().removeEventListener("change",c),a.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),a.clearTracks("audio");for(const u in t.AUDIO.tracks)a.audioTracks().addTrack(t.AUDIO.tracks[u])},VG=()=>{const n={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{n[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Zo,activeTrack:Zo,getActiveGroup:Zo,onGroupChanged:Zo,onTrackChanged:Zo,lastTrack_:null,logger_:no(`MediaGroups[${t}]`)}}),n};class q2{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(t){t===1&&(this.version_=t)}set ttl(t){this.ttl_=t||300}set reloadUri(t){t&&(this.reloadUri_=Nn(this.reloadUri_,t))}set priority(t){t&&t.length&&(this.priority_=t)}set pathwayClones(t){t&&t.length&&(this.pathwayClones_=new Map(t.map(o=>[o.ID,o])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class xG extends ie.EventTarget{constructor(t,o){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new q2,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=no("Content Steering"),this.xhr_=t,this.getBandwidth_=o}assignTagProperties(t,o){this.manifestType_=o.serverUri?"HLS":"DASH";const a=o.serverUri||o.serverURL;if(!a){this.logger_(`steering manifest URL is ${a}, cannot request steering manifest.`),this.trigger("error");return}if(a.startsWith("data:")){this.decodeDataUriManifest_(a.substring(a.indexOf(",")+1));return}this.steeringManifest.reloadUri=Nn(t,a),this.defaultPathway=o.pathwayId||o.defaultServiceLocation,this.queryBeforeStart=o.queryBeforeStart,this.proxyServerUrl_=o.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(t){const o=this.steeringManifest.reloadUri;if(!o)return;const a=t?o:this.getRequestURI(o);if(!a){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const i={contentSteeringInfo:{uri:a}};this.trigger({type:"contentsteeringloadstart",metadata:i}),this.request_=this.xhr_({uri:a,requestType:"content-steering-manifest"},(l,s)=>{if(l){if(s.status===410){this.logger_(`manifest request 410 ${l}.`),this.logger_(`There will be no more content steering requests to ${a} this session.`),this.excludedSteeringManifestURLs.add(a);return}if(s.status===429){const u=s.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${l}.`),this.logger_(`content steering will retry in ${u} seconds.`),this.startTTLTimeout_(parseInt(u,10));return}this.logger_(`manifest failed to load ${l}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:i});let r;try{r=JSON.parse(this.request_.responseText)}catch(u){const g={errorType:ie.Error.StreamingContentSteeringParserError,error:u};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(r);const c={contentSteeringInfo:i.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:c}),this.startTTLTimeout_()})}setProxyServerUrl_(t){const o=new K.URL(t),a=new K.URL(this.proxyServerUrl_);return a.searchParams.set("url",encodeURI(o.toString())),this.setSteeringParams_(a.toString())}decodeDataUriManifest_(t){const o=JSON.parse(K.atob(t));this.assignSteeringProperties_(o)}setSteeringParams_(t){const o=new K.URL(t),a=this.getPathway(),i=this.getBandwidth_();if(a){const l=`_${this.manifestType_}_pathway`;o.searchParams.set(l,a)}if(i){const l=`_${this.manifestType_}_throughput`;o.searchParams.set(l,i)}return o.toString()}assignSteeringProperties_(t){if(this.steeringManifest.version=t.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${t.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=t.TTL,this.steeringManifest.reloadUri=t["RELOAD-URI"],this.steeringManifest.priority=t["PATHWAY-PRIORITY"]||t["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=t["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const a=(i=>{for(const l of i)if(this.availablePathways_.has(l))return l;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==a&&(this.currentPathway=a,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(t){if(!t)return null;const o=i=>this.excludedSteeringManifestURLs.has(i);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(t);if(!o(i))return i}const a=this.setSteeringParams_(t);return o(a)?null:a}startTTLTimeout_(t=this.steeringManifest.ttl){const o=t*1e3;this.ttlTimeout_=K.setTimeout(()=>{this.requestSteeringManifest()},o)}clearTTLTimeout_(){K.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new q2}addAvailablePathway(t){t&&this.availablePathways_.add(t)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(t){return this.availablePathways_.delete(t)}didDASHTagChange(t,o){return!o&&this.steeringManifest.reloadUri||o&&(Nn(t,o.serverURL)!==this.steeringManifest.reloadUri||o.defaultServiceLocation!==this.defaultPathway||o.queryBeforeStart!==this.queryBeforeStart||o.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const kG=(n,t)=>{let o=null;return(...a)=>{clearTimeout(o),o=setTimeout(()=>{n.apply(null,a)},t)}},EG=10;let Ca;const TG=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],NG=function(n){return this.audioSegmentLoader_[n]+this.mainSegmentLoader_[n]},SG=function({currentPlaylist:n,buffered:t,currentTime:o,nextPlaylist:a,bufferLowWaterLine:i,bufferHighWaterLine:l,duration:s,bufferBasedABR:r,log:c}){if(!a)return ie.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${n&&n.id||"null"} -> ${a.id}`;if(!n)return c(`${u} as current playlist is not set`),!0;if(a.id===n.id)return!1;const g=!!el(t,o).length;if(!n.endList)return!g&&typeof n.partTargetDuration=="number"?(c(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${u} as current playlist is live`),!0);const m=lp(t,o),d=r?zt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:zt.MAX_BUFFER_LOW_WATER_LINE;if(s<d)return c(`${u} as duration < max low water line (${s} < ${d})`),!0;const p=a.attributes.BANDWIDTH,f=n.attributes.BANDWIDTH;if(p<f&&(!r||m<l)){let h=`${u} as next bandwidth < current bandwidth (${p} < ${f})`;return r&&(h+=` and forwardBuffer < bufferHighWaterLine (${m} < ${l})`),c(h),!0}if((!r||p>f)&&m>=i){let h=`${u} as forwardBuffer >= bufferLowWaterLine (${m} >= ${i})`;return r&&(h+=` and next bandwidth > current bandwidth (${p} > ${f})`),c(h),!0}return c(`not ${u} as no switching criteria met`),!1};class BG extends ie.EventTarget{constructor(t){super(),this.fastQualityChange_=kG(this.fastQualityChange_.bind(this),100);const{src:o,withCredentials:a,tech:i,bandwidth:l,externVhs:s,useCueTags:r,playlistExclusionDuration:c,enableLowInitialPlaylist:u,sourceType:g,cacheEncryptionKeys:m,bufferBasedABR:d,leastPixelDiffSelector:p,captionServices:f,experimentalUseMMS:h}=t;if(!o)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:V}=t;(V===null||typeof V>"u")&&(V=1/0),Ca=s,this.bufferBasedABR=!!d,this.leastPixelDiffSelector=!!p,this.withCredentials=a,this.tech_=i,this.vhs_=i.vhs,this.player_=t.player_,this.sourceType_=g,this.useCueTags_=r,this.playlistExclusionDuration=c,this.maxPlaylistRetries=V,this.enableLowInitialPlaylist=u,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:a,maxPlaylistRetries:V,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=VG(),h&&K.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new K.ManagedMediaSource,this.usingManagedMediaSource_=!0,ie.log("Using ManagedMediaSource")):K.MediaSource&&(this.mediaSource=new K.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=jt(),this.hasPlayed_=!1,this.syncController_=new dG(t),this.segmentMetadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new mG,this.sourceUpdater_=new v2(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new cG,this.keyStatusMap_=new Map;const w={vhs:this.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:f,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:l,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:m,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:t.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new yp(o,this.vhs_,at(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new ol(o,this.vhs_,at(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new xp(at(w,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),t),this.audioSegmentLoader_=new xp(at(w,{loaderType:"audio"}),t),this.subtitleSegmentLoader_=new aG(at(w,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((b,C)=>{function E(){i.off("vttjserror",x),b()}function x(){i.off("vttjsloaded",E),C()}i.one("vttjsloaded",E),i.one("vttjserror",x),i.addWebVttScript_()})}),t);const k=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new xG(this.vhs_.xhr,k),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),TG.forEach(b=>{this[b+"_"]=NG.bind(this,b)}),this.logger_=no("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(y,()=>{const b=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-b,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const t=this.mainAppendsToLoadedData_(),o=this.audioAppendsToLoadedData_();return t===-1||o===-1?-1:t+o}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(t="abr"){const o=this.selectPlaylist();o&&this.shouldSwitchToMedia_(o)&&this.switchMedia_(o,t)}switchMedia_(t,o,a){const i=this.media(),l=i&&(i.id||i.uri),s=t&&(t.id||t.uri);if(l&&l!==s){this.logger_(`switch media ${l} -> ${s} from ${o}`);const r={renditionInfo:{id:s,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:o};this.trigger({type:"renditionselected",metadata:r}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${o}`})}this.mainPlaylistLoader_.media(t,a)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{const o=this.mediaTypes_[t],a=o?o.activeGroup():null,i=this.contentSteeringController_.getPathway();if(a&&i){const s=(a.length?a[0].playlists:a.playlists).filter(r=>r.attributes.serviceLocation===i);s.length&&this.mediaTypes_[t].activePlaylistLoader.media(s[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=K.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(K.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const t=this.main(),o=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return o;const a=t.mediaGroups.AUDIO,i=Object.keys(a);let l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{const r=a.main||i.length&&a[i[0]];for(const c in r)if(r[c].default){l={label:c};break}}if(!l)return o;const s=[];for(const r in a)if(a[r][l.label]){const c=a[r][l.label];if(c.playlists&&c.playlists.length)s.push.apply(s,c.playlists);else if(c.uri)s.push(c);else if(t.playlists.length)for(let u=0;u<t.playlists.length;u++){const g=t.playlists[u];g.attributes&&g.attributes.AUDIO&&g.attributes.AUDIO===r&&s.push(g)}}return s.length?s:o}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const o=this.mainPlaylistLoader_.media(),a=o.targetDuration*1.5*1e3;cp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=a,o.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(o,this.requestOptions_),this.mainSegmentLoader_.load()),CG({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),o),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let o=this.mainPlaylistLoader_.media();if(!o){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let a;if(this.enableLowInitialPlaylist&&(a=this.selectInitialPlaylist()),a||(a=this.selectPlaylist()),!a||!this.shouldSwitchToMedia_(a)||(this.initialMedia_=a,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;o=this.initialMedia_}this.handleUpdatedMediaPlaylist(o)}),this.mainPlaylistLoader_.on("error",()=>{const o=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:o.playlist,error:o})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const o=this.mainPlaylistLoader_.media(),a=o.targetDuration*1.5*1e3;cp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=a,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(o,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const o=this.mainPlaylistLoader_.media();if(o.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(o)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(o=>{this.mainPlaylistLoader_.on(o,a=>{this.player_.trigger(Et({},a))})})}handleUpdatedMediaPlaylist(t){this.useCueTags_&&this.updateAdCues_(t),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!t.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(t,o){const a=t.mediaGroups||{};let i=!0;const l=Object.keys(a.AUDIO);for(const s in a.AUDIO)for(const r in a.AUDIO[s])a.AUDIO[s][r].uri||(i=!1);i&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(a.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Ca.Playlist.isAes(o)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),l.length&&Object.keys(a.AUDIO[l[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(t){const o=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),i=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),s=this.tech_.buffered();return SG({buffered:s,currentTime:a,currentPlaylist:o,nextPlaylist:t,bufferLowWaterLine:i,bufferHighWaterLine:l,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const a=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:a.playlist,error:a})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const a=this.audioSegmentLoader_.pendingSegment_;if(!a||!a.segment||!a.segment.syncInfo)return;const i=a.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",a=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:EG}))});const t=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const a=this.getCodecsOrExclude_();a&&this.sourceUpdater_.addOrChangeSourceBuffers(a)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(a=>{this.mainSegmentLoader_.on(a,i=>{this.player_.trigger(Et({},i))}),this.audioSegmentLoader_.on(a,i=>{this.player_.trigger(Et({},i))}),this.subtitleSegmentLoader_.on(a,i=>{this.player_.trigger(Et({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(t=this.selectPlaylist()){if(t&&t===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(t,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const t=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<t.start(0))return this.tech_.setCurrentTime(t.end(t.length-1))}setupFirstPlay(){const t=this.mainPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList||t.start){const o=this.seekable();if(!o.length)return!1;const a=o.end(0);let i=a;if(t.start){const l=t.start.timeOffset;l<0?i=Math.max(a+l,o.start(0)):i=Math.min(a,l)}this.trigger("firstplay"),this.tech_.setCurrentTime(i)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const t=this.tech_.play();typeof t<"u"&&typeof t.then=="function"&&t.then(null,o=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const t=this.inbandTextTracks_.metadataTrack_.cues;if(!t||!t.length)return;const o=this.duration();t[t.length-1].endTime=isNaN(o)||Math.abs(o)===1/0?Number.MAX_VALUE:o}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const o=this.mainSegmentLoader_.getCurrentMediaInfo_();!o||o.hasVideo?t=t&&this.audioSegmentLoader_.ended_:t=this.audioSegmentLoader_.ended_}t&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(t){if(!this.seekable().length)return!1;const a=this.syncController_.getExpiredTime(t,this.duration());if(a===null)return!1;const i=Ca.Playlist.playlistEnd(t,a),l=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-l<=Do;const r=s.end(s.length-1);return r-l<=Do&&i-r<=Do}excludePlaylist({playlistToExclude:t=this.mainPlaylistLoader_.media(),error:o={},playlistExclusionDuration:a}){if(t=t||this.mainPlaylistLoader_.media(),a=a||o.playlistExclusionDuration||this.playlistExclusionDuration,!t){this.error=o,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}t.playlistErrors_++;const i=this.mainPlaylistLoader_.main.playlists,l=i.filter(yc),s=l.length===1&&l[0]===t;if(i.length===1&&a!==1/0)return ie.log.warn(`Problem encountered with playlist ${t.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(s);if(s){if(this.main().contentSteering){const f=this.pathwayAttribute_(t),h=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(f),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(f)},h);return}let p=!1;i.forEach(f=>{if(f===t)return;const h=f.excludeUntil;typeof h<"u"&&h!==1/0&&(p=!0,delete f.excludeUntil)}),p&&(ie.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let r;t.playlistErrors_>this.maxPlaylistRetries?r=1/0:r=Date.now()+a*1e3,t.excludeUntil=r,o.reason&&(t.lastExcludeReason_=o.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const c=this.selectPlaylist();if(!c){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const u=o.internal?this.logger_:ie.log.warn,g=o.message?" "+o.message:"";u(`${o.internal?"Internal problem":"Problem"} encountered with playlist ${t.id}.${g} Switching to playlist ${c.id}.`),c.attributes.AUDIO!==t.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),c.attributes.SUBTITLES!==t.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const m=c.targetDuration/2*1e3||5*1e3,d=typeof c.lastRequest=="number"&&Date.now()-c.lastRequest<=m;return this.switchMedia_(c,"exclude",s||d)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(t,o){const a=[],i=t==="all";(i||t==="main")&&a.push(this.mainPlaylistLoader_);const l=[];(i||t==="audio")&&l.push("AUDIO"),(i||t==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(s=>{const r=this.mediaTypes_[s]&&this.mediaTypes_[s].activePlaylistLoader;r&&a.push(r)}),["main","audio","subtitle"].forEach(s=>{const r=this[`${s}SegmentLoader_`];r&&(t===s||t==="all")&&a.push(r)}),a.forEach(s=>o.forEach(r=>{typeof s[r]=="function"&&s[r]()}))}setCurrentTime(t){const o=el(this.tech_.buffered(),t);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(o&&o.length)return t;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const t=this.mainPlaylistLoader_.media();return t?t.endList?this.mediaSource?this.mediaSource.duration:Ca.Playlist.duration(t):1/0:0}seekable(){return this.seekable_}getSeekableRange_(t,o){const a=t.media();if(!a)return null;const i=this.syncController_.getMediaSequenceSync(o);if(i&&i.isReliable){const r=i.start,c=i.end;if(!isFinite(r)||!isFinite(c))return null;const u=Ca.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,a),g=Math.max(r,c-u);return jt([[r,g]])}const l=this.syncController_.getExpiredTime(a,this.duration());if(l===null)return null;const s=Ca.Playlist.seekable(a,l,Ca.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,a));return s.length?s:null}computeFinalSeekable_(t,o){if(!o)return t;const a=t.start(0),i=t.end(0),l=o.start(0),s=o.end(0);return l>i||a>s?t:jt([[Math.max(a,l),Math.min(i,s)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const t=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!t)return;let o;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(o=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!o))return;const a=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(t,o),!this.seekable_||a&&a.length&&this.seekable_.length&&a.start(0)===this.seekable_.start(0)&&a.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${A0(this.seekable_)}]`);const i={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:i}),this.tech_.trigger("seekablechanged")}updateDuration(t){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,t),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(t){const i=this.seekable();if(!i.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<i.end(i.length-1))&&this.sourceUpdater_.setDuration(i.end(i.length-1));return}const o=this.tech_.buffered();let a=Ca.Playlist.duration(this.mainPlaylistLoader_.media());o.length>0&&(a=Math.max(a,o.end(o.length-1))),this.mediaSource.duration!==a&&this.sourceUpdater_.setDuration(a)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(t=>{const o=this.mediaTypes_[t].groups;for(const a in o)o[a].forEach(i=>{i.playlistLoader&&i.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const t=!!this.mediaTypes_.AUDIO.activePlaylistLoader,o=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=t?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!o||!a)}getCodecsOrExclude_(){const t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},o=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;const a=ws(this.main(),o),i={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(i.video=a.video||t.main.videoCodec||JF),t.main.isMuxed&&(i.video+=`,${a.audio||t.main.audioCodec||Pf}`),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||l)&&(i.audio=a.audio||t.main.audioCodec||t.audio.audioCodec||Pf,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!i.audio&&!i.video){this.excludePlaylist({playlistToExclude:o,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const s=(u,g)=>u?Hl(g,this.usingManagedMediaSource_):Ru(g),r={};let c;if(["video","audio"].forEach(function(u){if(i.hasOwnProperty(u)&&!s(t[u].isFmp4,i[u])){const g=t[u].isFmp4?"browser":"muxer";r[g]=r[g]||[],r[g].push(i[u]),u==="audio"&&(c=g)}}),l&&c&&o.attributes.AUDIO){const u=o.attributes.AUDIO;this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===u&&g!==o&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${u} as ${c} does not support codec(s): "${i.audio}"`)}if(Object.keys(r).length){const u=Object.keys(r).reduce((g,m)=>(g&&(g+=", "),g+=`${m} does not support codec(s): "${r[m].join(",")}"`,g),"")+".";this.excludePlaylist({playlistToExclude:o,error:{internal:!0,message:u},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];if(["video","audio"].forEach(g=>{const m=(Vo(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,d=(Vo(i[g]||"")[0]||{}).type;m&&d&&m.toLowerCase()!==d.toLowerCase()&&u.push(`"${this.sourceUpdater_.codecs[g]}" -> "${i[g]}"`)}),u.length){this.excludePlaylist({playlistToExclude:o,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return i}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const t=this.getCodecsOrExclude_();if(!t)return;this.sourceUpdater_.createSourceBuffers(t);const o=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(o)}excludeUnsupportedVariants_(){const t=this.main().playlists,o=[];Object.keys(t).forEach(a=>{const i=t[a];if(o.indexOf(i.id)!==-1)return;o.push(i.id);const l=ws(this.main,i),s=[];l.audio&&!Ru(l.audio)&&!Hl(l.audio,this.usingManagedMediaSource_)&&s.push(`audio codec ${l.audio}`),l.video&&!Ru(l.video)&&!Hl(l.video,this.usingManagedMediaSource_)&&s.push(`video codec ${l.video}`),l.text&&l.text==="stpp.ttml.im1t"&&s.push(`text codec ${l.text}`),s.length&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: ${s.join(", ")}`))})}excludeIncompatibleVariants_(t){const o=[],a=this.main().playlists,i=_s(Vo(t)),l=Z0(i),s=i.video&&Vo(i.video)[0]||null,r=i.audio&&Vo(i.audio)[0]||null;Object.keys(a).forEach(c=>{const u=a[c];if(o.indexOf(u.id)!==-1||u.excludeUntil===1/0)return;o.push(u.id);const g=[],m=ws(this.mainPlaylistLoader_.main,u),d=Z0(m);if(!(!m.audio&&!m.video)){if(d!==l&&g.push(`codec count "${d}" !== "${l}"`),!this.sourceUpdater_.canChangeType()){const p=m.video&&Vo(m.video)[0]||null,f=m.audio&&Vo(m.audio)[0]||null;p&&s&&p.type.toLowerCase()!==s.type.toLowerCase()&&g.push(`video codec "${p.type}" !== "${s.type}"`),f&&r&&f.type.toLowerCase()!==r.type.toLowerCase()&&g.push(`audio codec "${f.type}" !== "${r.type}"`)}g.length&&(u.excludeUntil=1/0,this.logger_(`excluding ${u.id}: ${g.join(" && ")}`))}})}updateAdCues_(t){let o=0;const a=this.seekable();a.length&&(o=a.start(0)),lG(t,this.cueTagsTrack_,o)}goalBufferLength(){const t=this.tech_.currentTime(),o=zt.GOAL_BUFFER_LENGTH,a=zt.GOAL_BUFFER_LENGTH_RATE,i=Math.max(o,zt.MAX_GOAL_BUFFER_LENGTH);return Math.min(o+t*a,i)}bufferLowWaterLine(){const t=this.tech_.currentTime(),o=zt.BUFFER_LOW_WATER_LINE,a=zt.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(o,zt.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(o,zt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(o+t*a,this.bufferBasedABR?l:i)}bufferHighWaterLine(){return zt.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(t){B2(this.inbandTextTracks_,"com.apple.streaming",this.tech_),UW({inbandTextTracks:this.inbandTextTracks_,dateRanges:t})}addMetadataToTextTrack(t,o,a){const i=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();B2(this.inbandTextTracks_,t,this.tech_),vW({inbandTextTracks:this.inbandTextTracks_,metadataArray:o,timestampOffset:i,videoDuration:a})}pathwayAttribute_(t){return t.attributes["PATHWAY-ID"]||t.attributes.serviceLocation}initContentSteeringController_(){const t=this.main();if(t.contentSteering){for(const o of t.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(o));if(this.contentSteeringController_.assignTagProperties(t.uri,t.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(o=>{this.contentSteeringController_.on(o,a=>{this.trigger(Et({},a))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const o=this.main();(this.contentSteeringController_.didDASHTagChange(o.uri,o.contentSteering)||(()=>{const l=this.contentSteeringController_.getAvailablePathways(),s=[];for(const r of o.playlists){const c=r.attributes.serviceLocation;if(c&&(s.push(c),!l.has(c)))return!0}return!!(!s.length&&l.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const t=this.contentSteeringController_.getPathway();if(!t)return;this.handlePathwayClones_();const a=this.main().playlists,i=new Set;let l=!1;Object.keys(a).forEach(s=>{const r=a[s],c=this.pathwayAttribute_(r),u=c&&t!==c;r.excludeUntil===1/0&&r.lastExcludeReason_==="content-steering"&&!u&&(delete r.excludeUntil,delete r.lastExcludeReason_,l=!0);const m=!r.excludeUntil&&r.excludeUntil!==1/0;!i.has(r.id)&&u&&m&&(i.add(r.id),r.excludeUntil=1/0,r.lastExcludeReason_="content-steering",this.logger_(`excluding ${r.id} for ${r.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(s=>{const r=this.mediaTypes_[s];if(r.activePlaylistLoader){const c=r.activePlaylistLoader.media_;c&&c.attributes.serviceLocation!==t&&(l=!0)}}),l&&this.changeSegmentPathway_()}handlePathwayClones_(){const o=this.main().playlists,a=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(a&&a.size||i&&i.size){for(const[s,r]of a.entries())i.get(s)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(s));for(const[s,r]of i.entries()){const c=a.get(s);if(!c){o.filter(g=>g.attributes["PATHWAY-ID"]===r["BASE-ID"]).forEach(g=>{this.mainPlaylistLoader_.addClonePathway(r,g)}),this.contentSteeringController_.addAvailablePathway(s);continue}this.equalPathwayClones_(c,r)||(this.mainPlaylistLoader_.updateOrDeleteClone(r,!0),this.contentSteeringController_.addAvailablePathway(s))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(t,o){if(t["BASE-ID"]!==o["BASE-ID"]||t.ID!==o.ID||t["URI-REPLACEMENT"].HOST!==o["URI-REPLACEMENT"].HOST)return!1;const a=t["URI-REPLACEMENT"].PARAMS,i=o["URI-REPLACEMENT"].PARAMS;for(const l in a)if(a[l]!==i[l])return!1;for(const l in i)if(a[l]!==i[l])return!1;return!0}changeSegmentPathway_(){const t=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(t,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let t=0;const o="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(a=>{const i=this.mainPlaylistLoader_.getKeyIdSet(a);!i||!i.size||i.forEach(l=>{const s="usable",r=this.keyStatusMap_.has(l)&&this.keyStatusMap_.get(l)===s,c=a.lastExcludeReason_===o&&a.excludeUntil===1/0;r?r&&c&&(delete a.excludeUntil,delete a.lastExcludeReason_,this.logger_(`enabling playlist ${a.id} because key ID ${l} is ${s}`)):(a.excludeUntil!==1/0&&a.lastExcludeReason_!==o&&(a.excludeUntil=1/0,a.lastExcludeReason_=o,this.logger_(`excluding playlist ${a.id} because the key ID ${l} doesn't exist in the keyStatusMap or is not ${s}`)),t++)})}),t>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(a=>{const i=a&&a.attributes&&a.attributes.RESOLUTION&&a.attributes.RESOLUTION.height<720,l=a.excludeUntil===1/0&&a.lastExcludeReason_===o;i&&l&&(delete a.excludeUntil,ie.log.warn(`enabling non-HD playlist ${a.id} because all playlists were excluded due to ${o} key IDs`))})}addKeyStatus_(t,o){const l=(typeof t=="string"?t:nG(t)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${o}' with key ID ${l} added to the keyStatusMap`),this.keyStatusMap_.set(l,o)}updatePlaylistByKeyStatus(t,o){this.addKeyStatus_(t,o),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const PG=(n,t,o)=>a=>{const i=n.main.playlists[t],l=dp(i),s=yc(i);if(typeof a>"u")return s;a?delete i.disabled:i.disabled=!0;const r={renditionInfo:{id:t,bandwidth:i.attributes.BANDWIDTH,resolution:i.attributes.RESOLUTION,codecs:i.attributes.CODECS},cause:"fast-quality"};return a!==s&&!l&&(a?(o(i),n.trigger({type:"renditionenabled",metadata:r})):n.trigger({type:"renditiondisabled",metadata:r})),a};class DG{constructor(t,o,a){const{playlistController_:i}=t,l=i.fastQualityChange_.bind(i);if(o.attributes){const s=o.attributes.RESOLUTION;this.width=s&&s.width,this.height=s&&s.height,this.bandwidth=o.attributes.BANDWIDTH,this.frameRate=o.attributes["FRAME-RATE"]}this.codecs=ws(i.main(),o),this.playlist=o,this.id=a,this.enabled=PG(t.playlists,o.id,l)}}const $G=function(n){n.representations=()=>{const t=n.playlistController_.main(),o=ys(t)?n.playlistController_.getAudioTrackPlaylists_():t.playlists;return o?o.filter(a=>!dp(a)).map((a,i)=>new DG(n,a,a.id)):[]}},W2=["seeking","seeked","pause","playing","error"];class LG extends ie.EventTarget{constructor(t){super(),this.playlistController_=t.playlistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=no("PlaybackWatcher"),this.logger_("initialize");const o=()=>this.monitorCurrentTime_(),a=()=>this.monitorCurrentTime_(),i=()=>this.techWaiting_(),l=()=>this.resetTimeUpdate_(),s=this.playlistController_,r=["main","subtitle","audio"],c={};r.forEach(g=>{c[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},s[`${g}SegmentLoader_`].on("appendsdone",c[g].updateend),s[`${g}SegmentLoader_`].on("playlistupdate",c[g].reset),this.tech_.on(["seeked","seeking"],c[g].reset)});const u=g=>{["main","audio"].forEach(m=>{s[`${m}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",i),this.tech_.on(W2,l),this.tech_.on("canplay",a),this.tech_.one("play",o),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",i),this.tech_.off(W2,l),this.tech_.off("canplay",a),this.tech_.off("play",o),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),r.forEach(g=>{s[`${g}SegmentLoader_`].off("appendsdone",c[g].updateend),s[`${g}SegmentLoader_`].off("playlistupdate",c[g].reset),this.tech_.off(["seeked","seeking"],c[g].reset)}),this.checkCurrentTimeTimeout_&&K.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&K.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=K.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(t){const o=this.playlistController_[`${t}SegmentLoader_`];this[`${t}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${t} loader`),this[`${t}StalledDownloads_`]=0,this[`${t}Buffered_`]=o.buffered_()}checkSegmentDownloads_(t){const o=this.playlistController_,a=o[`${t}SegmentLoader_`],i=a.buffered_(),l=Cq(this[`${t}Buffered_`],i);if(this[`${t}Buffered_`]=i,l){const s={bufferedRanges:i};o.trigger({type:"bufferedrangeschanged",metadata:s}),this.resetSegmentDownloads_(t);return}this[`${t}StalledDownloads_`]++,this.logger_(`found #${this[`${t}StalledDownloads_`]} ${t} appends that did not increase buffer (possible stalled download)`,{playlistId:a.playlist_&&a.playlist_.id,buffered:Ja(i)}),!(this[`${t}StalledDownloads_`]<10)&&(this.logger_(`${t} loader stalled download exclusion`),this.resetSegmentDownloads_(t),this.tech_.trigger({type:"usage",name:`vhs-${t}-download-exclusion`}),t!=="subtitle"&&o.excludePlaylist({error:{message:`Excessive ${t} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const t=this.tech_.currentTime(),o=this.tech_.buffered();if(this.lastRecordedTime===t&&(!o.length||t+Do>=o.end(o.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&t===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(t===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(jt([this.lastRecordedTime,t]));const a={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:a}),this.consecutiveUpdates=0,this.lastRecordedTime=t}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const o=this.seekable(),a=this.tech_.currentTime(),i=this.afterSeekableWindow_(o,a,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let l;if(i&&(l=o.end(o.length-1)),this.beforeSeekableWindow_(o,a)){const f=o.start(0);l=f+(f===o.end(0)?0:Do)}if(typeof l<"u")return this.logger_(`Trying to seek outside of seekable at time ${a} with seekable range ${A0(o)}. Seeking to ${l}.`),this.tech_.setCurrentTime(l),!0;const s=this.playlistController_.sourceUpdater_,r=this.tech_.buffered(),c=s.audioBuffer?s.audioBuffered():null,u=s.videoBuffer?s.videoBuffered():null,g=this.media(),m=g.partTargetDuration?g.partTargetDuration:(g.targetDuration-Po)*2,d=[c,u];for(let f=0;f<d.length;f++){if(!d[f])continue;if(lp(d[f],a)<m)return!1}const p=gc(r,a);return p.length===0?!1:(l=p.start(0)+Do,this.logger_(`Buffered region starts (${p.start(0)}) just beyond seek point (${a}). Seeking to ${l}.`),this.tech_.setCurrentTime(l),!0)}waiting_(){if(this.techWaiting_())return;const t=this.tech_.currentTime(),o=this.tech_.buffered(),a=el(o,t);if(a.length&&t+3<=a.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.logger_(`Stopped at ${t} while inside a buffered region [${a.start(0)} -> ${a.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const t=this.seekable(),o=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(t,o)){const r=t.end(t.length-1);return this.logger_(`Fell out of live window at time ${o}. Seeking to live point (seekable end) ${r}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(r),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const a=this.tech_.vhs.playlistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:o}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const s=gc(i,o);return s.length>0?(this.logger_(`Stopped at ${o} and seeking to ${s.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(o),!0):!1}afterSeekableWindow_(t,o,a,i=!1){if(!t.length)return!1;let l=t.end(t.length-1)+Do;const s=!a.endList,r=typeof a.partTargetDuration=="number";return s&&(r||i)&&(l=t.end(t.length-1)+a.targetDuration*3),o>l}beforeSeekableWindow_(t,o){return!!(t.length&&t.start(0)>0&&o<t.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:t,audioBuffered:o,currentTime:a}){if(!t)return;let i;if(t.length&&o.length){const l=el(t,a-3),s=el(t,a),r=el(o,a);r.length&&!s.length&&l.length&&(i={start:l.end(0),end:r.end(0)})}else gc(t,a).length||(i=this.gapFromVideoUnderflow_(t,a));return i?(this.logger_(`Encountered a gap in video from ${i.start} to ${i.end}. Seeking to current time ${a}`),!0):!1}skipTheGap_(t){const o=this.tech_.buffered(),a=this.tech_.currentTime(),i=gc(o,a);if(this.resetTimeUpdate_(),i.length===0||a!==t)return;this.logger_("skipTheGap_:","currentTime:",a,"scheduled currentTime:",t,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+Po);const l={gapInfo:{from:a,to:i.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:l}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(t,o){const a=_q(t);for(let i=0;i<a.length;i++){const l=a.start(i),s=a.end(i);if(o-l<4&&o-l>2)return{start:l,end:s}}return null}}const AG={errorInterval:30,getSource(n){const o=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return n(o)}},G2=function(n,t){let o=0,a=0;const i=at(AG,t);n.ready(()=>{n.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const l=function(){a&&n.currentTime(a)},s=function(g){g!=null&&(a=n.duration()!==1/0&&n.currentTime()||0,n.one("loadedmetadata",l),n.src(g),n.trigger({type:"usage",name:"vhs-error-reload"}),n.play())},r=function(){if(Date.now()-o<i.errorInterval*1e3){n.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!i.getSource||typeof i.getSource!="function"){ie.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return o=Date.now(),i.getSource.call(n,s)},c=function(){n.off("loadedmetadata",l),n.off("error",r),n.off("dispose",c)},u=function(g){c(),G2(n,g)};n.on("error",r),n.on("dispose",c),n.reloadSourceOnError=u},IG=function(n){G2(this,n)};var X2="3.17.2",vG="7.1.0",MG="1.3.1",OG="7.2.0",UG="4.0.2";const Vt={PlaylistLoader:ol,Playlist:Sn,utils:qq,STANDARD_PLAYLIST_SELECTOR:N2,INITIAL_PLAYLIST_SELECTOR:DW,lastBandwidthSelector:N2,movingAverageBandwidthSelector:BW,comparePlaylistBandwidth:Cp,comparePlaylistResolution:SW,xhr:o2()};Object.keys(zt).forEach(n=>{Object.defineProperty(Vt,n,{get(){return ie.log.warn(`using Vhs.${n} is UNSAFE be sure you know what you are doing`),zt[n]},set(t){if(ie.log.warn(`using Vhs.${n} is UNSAFE be sure you know what you are doing`),typeof t!="number"||t<0){ie.log.warn(`value of Vhs.${n} must be greater than or equal to 0`);return}zt[n]=t}})});const Y2="videojs-vhs",K2=function(n,t){const o=t.media();let a=-1;for(let i=0;i<n.length;i++)if(n[i].id===o.id){a=i;break}n.selectedIndex_=a,n.trigger({selectedIndex:a,type:"change"})},RG=function(n,t){t.representations().forEach(o=>{n.addQualityLevel(o)}),K2(n,t.playlists)};Vt.canPlaySource=function(){return ie.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const FG=(n,t,o)=>{if(!n)return n;let a={};t&&t.attributes&&t.attributes.CODECS&&(a=_s(Vo(t.attributes.CODECS))),o&&o.attributes&&o.attributes.CODECS&&(a.audio=o.attributes.CODECS);const i=ki(a.video),l=ki(a.audio),s={};for(const r in n)s[r]={},l&&(s[r].audioContentType=l),i&&(s[r].videoContentType=i),t.contentProtection&&t.contentProtection[r]&&t.contentProtection[r].pssh&&(s[r].pssh=t.contentProtection[r].pssh),typeof n[r]=="string"&&(s[r].url=n[r]);return at(n,s)},HG=(n,t)=>n.reduce((o,a)=>{if(!a.contentProtection)return o;const i=t.reduce((l,s)=>{const r=a.contentProtection[s];return r&&r.pssh&&(l[s]={pssh:r.pssh}),l},{});return Object.keys(i).length&&o.push(i),o},[]),jG=({player:n,sourceKeySystems:t,audioMedia:o,mainPlaylists:a})=>{if(!n.eme.initializeMediaKeys)return Promise.resolve();const i=o?a.concat([o]):a,l=HG(i,Object.keys(t)),s=[],r=[];return l.forEach(c=>{r.push(new Promise((u,g)=>{n.tech_.one("keysessioncreated",u)})),s.push(new Promise((u,g)=>{n.eme.initializeMediaKeys({keySystems:c},m=>{if(m){g(m);return}u()})}))}),Promise.race([Promise.all(s),Promise.race(r)])},zG=({player:n,sourceKeySystems:t,media:o,audioMedia:a})=>{const i=FG(t,o,a);return i?(n.currentSource().keySystems=i,i&&!n.eme?(ie.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Q2=()=>{if(!K.localStorage)return null;const n=K.localStorage.getItem(Y2);if(!n)return null;try{return JSON.parse(n)}catch{return null}},qG=n=>{if(!K.localStorage)return!1;let t=Q2();t=t?at(t,n):n;try{K.localStorage.setItem(Y2,JSON.stringify(t))}catch{return!1}return t},WG=n=>n.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(n.substring(n.indexOf(",")+1)):n,Z2=(n,t)=>{n._requestCallbackSet||(n._requestCallbackSet=new Set),n._requestCallbackSet.add(t)},J2=(n,t)=>{n._responseCallbackSet||(n._responseCallbackSet=new Set),n._responseCallbackSet.add(t)},ey=(n,t)=>{n._requestCallbackSet&&(n._requestCallbackSet.delete(t),n._requestCallbackSet.size||delete n._requestCallbackSet)},ty=(n,t)=>{n._responseCallbackSet&&(n._responseCallbackSet.delete(t),n._responseCallbackSet.size||delete n._responseCallbackSet)};Vt.supportsNativeHls=function(){if(!ye||!ye.createElement)return!1;const n=ye.createElement("video");return ie.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(o){return/maybe|probably/i.test(n.canPlayType(o))}):!1}(),Vt.supportsNativeDash=function(){return!ye||!ye.createElement||!ie.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ye.createElement("video").canPlayType("application/dash+xml"))}(),Vt.supportsTypeNatively=n=>n==="hls"?Vt.supportsNativeHls:n==="dash"?Vt.supportsNativeDash:!1,Vt.isSupported=function(){return ie.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Vt.xhr.onRequest=function(n){Z2(Vt.xhr,n)},Vt.xhr.onResponse=function(n){J2(Vt.xhr,n)},Vt.xhr.offRequest=function(n){ey(Vt.xhr,n)},Vt.xhr.offResponse=function(n){ty(Vt.xhr,n)};const GG=ie.getComponent("Component");class ny extends GG{constructor(t,o,a){if(super(o,a.vhs),typeof a.initialBandwidth=="number"&&(this.options_.bandwidth=a.initialBandwidth),this.logger_=no("VhsHandler"),o.options_&&o.options_.playerId){const i=ie.getPlayer(o.options_.playerId);this.player_=i}if(this.tech_=o,this.source_=t,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&o.overrideNativeAudioTracks&&o.overrideNativeVideoTracks)o.overrideNativeAudioTracks(!0),o.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(o.featuresNativeVideoTracks||o.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(ye,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],i=>{const l=ye.fullscreenElement||ye.webkitFullscreenElement||ye.mozFullScreenElement||ye.msFullscreenElement;l&&l.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(t={}){if(this.options_=at(this.options_,t),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const a=Q2();a&&a.bandwidth&&(this.options_.bandwidth=a.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),a&&a.throughput&&(this.options_.throughput=a.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=zt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===zt.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(a=>{typeof this.source_[a]<"u"&&(this.options_[a]=this.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const o=this.options_.customPixelRatio;typeof o=="number"&&o>=0&&(this.customPixelRatio=o)}setOptions(t={}){this.setOptions_(t)}src(t,o){if(!t)return;this.setOptions_(),this.options_.src=WG(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Vt,this.options_.sourceType=Df(o),this.options_.seekTo=l=>{this.tech_.setCurrentTime(l)},this.options_.player_=this.player_,this.playlistController_=new BG(this.options_);const a=at({liveRangeSafeTimeDelta:Do},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new LG(a),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const l=ie.players[this.tech_.options_.playerId];let s=this.playlistController_.error;typeof s=="object"&&!s.code?s.code=3:typeof s=="string"&&(s={message:s,code:3}),l.error(s)});const i=this.options_.bufferBasedABR?Vt.movingAverageBandwidthSelector(.55):Vt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):i.bind(this),this.playlistController_.selectInitialPlaylist=Vt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(l){this.playlistController_.selectPlaylist=l.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(l){this.playlistController_.mainSegmentLoader_.throughput.rate=l,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let l=this.playlistController_.mainSegmentLoader_.bandwidth;const s=K.navigator.connection||K.navigator.mozConnection||K.navigator.webkitConnection,r=1e7;if(this.options_.useNetworkInformationApi&&s){const c=s.downlink*1e3*1e3;c>=r&&l>=r?l=Math.max(l,c):l=c}return l},set(l){this.playlistController_.mainSegmentLoader_.bandwidth=l,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const l=1/(this.bandwidth||1);let s;return this.throughput>0?s=1/this.throughput:s=0,Math.floor(1/(l+s))},set(){ie.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ja(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Ja(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&qG({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{$G(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=K.URL.createObjectURL(this.playlistController_.mediaSource),(ie.browser.IS_ANY_SAFARI||ie.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),jG({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(o=>{this.logger_("error while creating EME key session",o),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,o=zG({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});if(this.player_.tech_.on("keystatuschange",a=>{this.playlistController_.updatePlaylistByKeyStatus(a.keyId,a.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!o){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const t=ie.players[this.tech_.options_.playerId];!t||!t.qualityLevels||this.qualityLevels_||(this.qualityLevels_=t.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{RG(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{K2(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":X2,"mux.js":vG,"mpd-parser":MG,"m3u8-parser":OG,"aes-decrypter":UG}}version(){return this.constructor.version()}canChangeType(){return v2.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(t){this.playlistController_.setCurrentTime(t)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&K.URL.revokeObjectURL&&(K.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(t,o){return Zq({playlist:this.playlistController_.media(),time:t,callback:o})}seekToProgramTime(t,o,a=!0,i=2){return r2({programTime:t,playlist:this.playlistController_.media(),retryCount:i,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:o})}setupXhrHooks_(){this.xhr.onRequest=t=>{Z2(this.xhr,t)},this.xhr.onResponse=t=>{J2(this.xhr,t)},this.xhr.offRequest=t=>{ey(this.xhr,t)},this.xhr.offResponse=t=>{ty(this.xhr,t)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const t=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],o=["gapjumped","playedrangeschanged"];t.forEach(a=>{this.playlistController_.on(a,i=>{this.player_.trigger(Et({},i))})}),o.forEach(a=>{this.playbackWatcher_.on(a,i=>{this.player_.trigger(Et({},i))})})}}const Vc={name:"videojs-http-streaming",VERSION:X2,canHandleSource(n,t={}){const o=at(ie.options,t);return!o.vhs.experimentalUseMMS&&!Hl("avc1.4d400d,mp4a.40.2",!1)?!1:Vc.canPlayType(n.type,o)},handleSource(n,t,o={}){const a=at(ie.options,o);return t.vhs=new ny(n,t,a),t.vhs.xhr=o2(),t.vhs.setupXhrHooks_(),t.vhs.src(n.src,n.type),t.vhs},canPlayType(n,t){const o=Df(n);if(!o)return"";const a=Vc.getOverrideNative(t);return!Vt.supportsTypeNatively(o)||a?"maybe":""},getOverrideNative(n={}){const{vhs:t={}}=n,o=!(ie.browser.IS_ANY_SAFARI||ie.browser.IS_IOS),{overrideNative:a=o}=t;return a}};Hl("avc1.4d400d,mp4a.40.2",!0)&&ie.getTech("Html5").registerSourceHandler(Vc,0),ie.VhsHandler=ny,ie.VhsSourceHandler=Vc,ie.Vhs=Vt,ie.use||ie.registerComponent("Vhs",Vt),ie.options.vhs=ie.options.vhs||{},(!ie.getPlugin||!ie.getPlugin("reloadSourceOnError"))&&ie.registerPlugin("reloadSourceOnError",IG);const XG={name:"MediaVideoPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""}},data(){return{player:null}},mounted(){this.player=ie(this.$refs.videoPlayer,{autoplay:!1,controls:!0,muted:!0,fluid:!0,sources:[{src:this.url,type:"video/mp4"}],poster:this.poster})},beforeDestroy(){this.player&&this.player.dispose()}},YG={ref:"videoPlayer",class:"video-js"};function KG(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("video",YG,null,512)}const QG=ee(XG,[["render",KG],["__scopeId","data-v-3e044975"]]),ZG={name:"YoutubePlayer",props:{url:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},control:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,player:null}},watch:{isPlaying(){this.resetVideo()}},methods:{resetVideo(){this.player=null,this.isRender=!1,this.$nextTick(()=>{this.isRender=!0,this.$nextTick(()=>{setTimeout(this.initPlayer,300)})})},initPlayer(){if(!YT||!document.getElementById(`yt-player-${this.timestamp}`)){setTimeout(this.initPlayer,3e3);return}this.player||(this.player=new YT.Player(`yt-player-${this.timestamp}`,{origin:"http://localhost:3000/",events:{onStateChange:this.onPlayerStateChange}}))},onPlayerStateChange(){this.player.getPlayerState()==0&&this.$emit("playEnd")}},mounted(){this.$nextTick(()=>{setTimeout(this.initPlayer,300)})}},JG={class:"youtube-player"},eX=["id","src"];function tX(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("div",JG,[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["video-foreground",{"show-control-n-fit":o.control}])},[e.createElementVNode("iframe",{id:`yt-player-${i.timestamp}`,ref:"player",width:"1280",height:"537",src:`${o.url}?enablejsapi=1&controls=${o.control?1:0}&autoplay=${o.autoplay||o.isPlaying}&mute=${o.mute?1:0}`,title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",sandbox:"allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation"},null,8,eX)],2)):e.createCommentVNode("",!0)])}const nX=ee(ZG,[["render",tX],["__scopeId","data-v-ca2b2fbb"]]),oX={name:"BilibiliPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,wrapperRatio:1}},computed:{isVideoWider(){return this.wrapperRatio>1}},watch:{isPlaying(n,t){this.resetVideo()}},methods:{resetVideo(){this.isRender=!1,this.$nextTick(()=>{this.isRender=!0})}},mounted(){this.$nextTick(()=>{this.wrapperRatio=this.$refs.wrapper.clientWidth/this.$refs.wrapper.clientHeight})}},aX={class:"bilibili-player",ref:"wrapper"},iX=["id","src"];function lX(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("div",aX,[e.createElementVNode("div",{class:e.normalizeClass(["video-foreground",[{"video-foreground--wider":l.isVideoWider,"video-foreground--higher":!l.isVideoWider}]])},[i.isRender?(e.openBlock(),e.createElementBlock("iframe",{key:0,id:`bilibili-player-${i.timestamp}`,scrolling:"no",border:"0",frameborder:"no",framespacing:"0",allowfullscreen:"true",src:`${o.url}&high_quality=1&danmaku=0&as_wide=1`},null,8,iX)):e.createCommentVNode("",!0)],2)],512)}const sX=ee(oX,[["render",lX],["__scopeId","data-v-40e15401"]]),rX={name:"YoukuPlayer",props:{url:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0}},methods:{resetVideo(){this.isRender=!1,this.$nextTick(()=>{this.isRender=!0})}}},dX={class:"youku-player"},cX=["src","id"];function uX(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("div",dX,[e.createElementVNode("iframe",{width:"1280",height:"537",src:`${o.url}?rel=0&autoplay=${o.isPlaying}`,frameborder:"0",allowfullscreen:"",id:`youku-player-${i.timestamp}`,sandbox:"allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation"},null,8,cX)])}const mX=ee(rX,[["render",uX],["__scopeId","data-v-cf32c3a0"]]),pX={name:"QqPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,player:null,wrapperRatio:1}},computed:{isVideoWider(){return this.wrapperRatio>1}},watch:{isPlaying(){this.resetVideo()}},methods:{resetVideo(){this.player=null,this.isRender=!1,this.$nextTick(()=>{this.isRender=!0,this.$nextTick(()=>{setTimeout(this.initPlayer,300)})})},initPlayer(){const n=document.getElementById(`qq-player-${this.timestamp}`);if(!Txp||!n){setTimeout(this.initPlayer,3e3);return}if(this.player)return;this.player=new Txp.Player({containerId:`qq-player-${this.timestamp}`,vid:this.url,width:"100%",height:"100%",autoplay:this.autoplay||this.$_vsWidth>=768||this.isPlaying,mini:!0,muted:this.mute,volume:this.mute?0:50});const t=n.querySelector("iframe");t.sandbox="allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation",this.player.on("playStateChange",this.onPlayerStateChange)},onPlayerStateChange(n){n.state==0&&this.$emit("playEnd")}},mounted(){this.$nextTick(()=>{this.wrapperRatio=this.$refs.wrapper.clientWidth/this.$refs.wrapper.clientHeight,setTimeout(this.initPlayer,300)})}},hX={class:"qq-player",ref:"wrapper"},fX=["id"],gX={class:"qq-player__poster"},yX=["src"];function _X(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("div",hX,[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["video-foreground",[{"video-foreground--wider":l.isVideoWider,"video-foreground--higher":!l.isVideoWider}]])},[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:"iframe",id:`qq-player-${i.timestamp}`},null,8,fX)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",gX,[e.createElementVNode("img",{src:o.poster,alt:"poster"},null,8,yX)],512),[[e.vShow,!o.isPlaying&&!o.autoplay]])],512)}const wX=ee(pX,[["render",_X],["__scopeId","data-v-719611b1"]]),bX={name:"FbPlayer",props:{html:{type:String,default:()=>""}},mounted(){this.loadFacebookSDK()},methods:{loadFacebookSDK(){if(document.querySelector('script[src*="connect.facebook.net"]'))return;const n=document.createElement("script");n.async=!0,n.defer=!0,n.crossOrigin="anonymous",n.src="https://connect.facebook.net/zh_TW/sdk.js#xfbml=1&version=v14.0",n.nonce="5tyirFAy",document.body.appendChild(n)}}},CX={class:"fb-player",ref:"wrapper"},VX=["innerHTML"];function xX(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("div",CX,[t[0]||(t[0]=e.createElementVNode("div",{id:"fb-root"},null,-1)),e.createElementVNode("div",{innerHTML:o.html},null,8,VX)],512)}const kX=ee(bX,[["render",xX],["__scopeId","data-v-c5a2a3ed"]]),EX={class:"media_video_wrap"},TX={class:"img-wrapper"},NX={key:0},SX={key:1},BX={key:2},PX={key:3},DX={key:4},$X={key:5},xc=ee(e.defineComponent({name:"MediaVideo",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const o=n,a=t,i=e.ref(!1),l=()=>{var f;if(o.modelValue&&o.modelValue.data)return;const p={id:((f=o.modelValue)==null?void 0:f.id)||F(),type:"MediaVideo",onlyShowPc:!1,data:{width:"中",type:"inner",videoSrc:"https://mvideo.ycyw.com/2e1a9441vodgzp1253458132/a31402d51397757891052265568/SW8B19vOtzMA.mp4",videoThumbnail:"https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg"}};a("update:modelValue",p)},s=e.computed(()=>{var p;return o.isPreview?!((p=o.modelValue)!=null&&p.onlyShowPc)||!Ne():!0}),r=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var h,V;const p=(V=(h=o.modelValue)==null?void 0:h.data)==null?void 0:V.width;return!p||p==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[p]||"container-content"}),g=()=>{a("handleDelete",o.modelValue.id)},m=()=>{a("handleCopy",o.modelValue)},d=p=>{a("handlePaste",p)};return l(),(p,f)=>{var h,V,w,k,y,b,C,E,x,N,$,S;return e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mediaVideo_wrap_box",onMouseenter:f[2]||(f[2]=I=>r.value=!0),onMouseleave:f[3]||(f[3]=I=>r.value=!1)},[e.createElementVNode("div",EX,[e.createElementVNode("div",{class:e.normalizeClass(["media-video__container",u.value])},[e.createElementVNode("div",TX,[((V=(h=n.modelValue)==null?void 0:h.data)==null?void 0:V.type)==="inner"?(e.openBlock(),e.createElementBlock("div",NX,[e.createVNode(QG,{url:n.modelValue.data.videoSrc,poster:n.modelValue.data.videoThumbnail},null,8,["url","poster"])])):e.createCommentVNode("",!0),((k=(w=n.modelValue)==null?void 0:w.data)==null?void 0:k.type)==="youtube"?(e.openBlock(),e.createElementBlock("div",SX,[e.createVNode(nX,{url:n.modelValue.data.videoSrc,isPlaying:i.value,control:!0,autoplay:i.value},null,8,["url","isPlaying","autoplay"])])):e.createCommentVNode("",!0),((b=(y=n.modelValue)==null?void 0:y.data)==null?void 0:b.type)==="bilibili"?(e.openBlock(),e.createElementBlock("div",BX,[e.createVNode(sX,{url:n.modelValue.data.videoSrc,isPlaying:i.value},null,8,["url","isPlaying"])])):e.createCommentVNode("",!0),((E=(C=n.modelValue)==null?void 0:C.data)==null?void 0:E.type)==="youku"?(e.openBlock(),e.createElementBlock("div",PX,[e.createVNode(mX,{url:n.modelValue.data.videoSrc,isPlaying:i.value},null,8,["url","isPlaying"])])):e.createCommentVNode("",!0),((N=(x=n.modelValue)==null?void 0:x.data)==null?void 0:N.type)==="qq"?(e.openBlock(),e.createElementBlock("div",DX,[e.createVNode(wX,{url:n.modelValue.data.videoSrc,isPlaying:i.value,autoplay:i.value},null,8,["url","isPlaying","autoplay"])])):e.createCommentVNode("",!0),((S=($=n.modelValue)==null?void 0:$.data)==null?void 0:S.type)==="facebook"?(e.openBlock(),e.createElementBlock("div",$X,[e.createVNode(kX,{html:n.modelValue.data.videoSrc},null,8,["html"])])):e.createCommentVNode("",!0)])],2)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:r.value,"onUpdate:show":f[0]||(f[0]=I=>r.value=I),onHandleEdit:f[1]||(f[1]=I=>c.value=!0),onHandleDelete:g,onHandleCopy:m,onHandlePaste:d},null,8,["show"]))],32)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(qR,{key:1,show:c.value,"onUpdate:show":f[4]||(f[4]=I=>c.value=I),data:n.modelValue},null,8,["show","data"]))],64)}}}),[["__scopeId","data-v-f642da26"]]),LX=Object.freeze(Object.defineProperty({__proto__:null,default:xc},Symbol.toStringTag,{value:"Module"})),AX={class:"setting-content"},IX={class:"setting-header flex items-center"},vX=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){e.defineAsyncComponent(()=>Promise.resolve().then(()=>_t));const o=t,a=()=>{o("update:show",!1)};return(i,l)=>{const s=e.resolveComponent("a-switch"),r=e.resolveComponent("a-option"),c=e.resolveComponent("a-select"),u=e.resolveComponent("a-input"),g=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(g,{width:500,visible:n.show,footer:!1,onCancel:a,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",AX,[e.createElementVNode("div",IX,[l[4]||(l[4]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(s,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":l[0]||(l[0]=m=>n.data.onlyShowPc=m)},null,8,["modelValue"])]),l[9]||(l[9]=e.createElementVNode("p",{class:"item-title"},"组件宽度",-1)),e.createVNode(c,{modelValue:n.data.data.width,"onUpdate:modelValue":l[1]||(l[1]=m=>n.data.data.width=m),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode(r,{value:""},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createTextVNode("默认",-1)])]),_:1}),e.createVNode(r,{value:"small"},{default:e.withCtx(()=>[...l[6]||(l[6]=[e.createTextVNode("小",-1)])]),_:1}),e.createVNode(r,{value:"middle"},{default:e.withCtx(()=>[...l[7]||(l[7]=[e.createTextVNode("中",-1)])]),_:1}),e.createVNode(r,{value:"max"},{default:e.withCtx(()=>[...l[8]||(l[8]=[e.createTextVNode("大",-1)])]),_:1})]),_:1},8,["modelValue"]),l[10]||(l[10]=e.createElementVNode("p",{class:"item-title"},"标题",-1)),e.createVNode(u,{modelValue:n.data.data.title,"onUpdate:modelValue":l[2]||(l[2]=m=>n.data.data.title=m),placeholder:"请输入标题","allow-clear":""},null,8,["modelValue"]),l[11]||(l[11]=e.createElementVNode("p",{class:"item-title"},"链接",-1)),e.createVNode(u,{modelValue:n.data.data.link,"onUpdate:modelValue":l[3]||(l[3]=m=>n.data.data.link=m),placeholder:"请输入链接","allow-clear":""},null,8,["modelValue"])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-ba14f699"]]),MX={class:"information-link__wrapper"},OX={key:0},UX=["innerHTML"],RX={key:1,class:"information-link__btn btn p-0",type:"button"},FX=["innerHTML"],kc=ee(e.defineComponent({name:"InformationLink",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,a=t,i=p=>{a("handleClick",p)},l=e.computed(()=>{var p;return o.isPreview?!((p=o.modelValue)!=null&&p.onlyShowPc)||!Ne():!0}),s=()=>{var f;if(o.modelValue&&o.modelValue.data)return;const p={id:((f=o.modelValue)==null?void 0:f.id)||F(),type:"InformationLink",onlyShowPc:!1,data:{width:"中",title:"这里是标题",link:"https://www.baidu.com"}};a("update:modelValue",p)},r=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var h,V;const p=(V=(h=o.modelValue)==null?void 0:h.data)==null?void 0:V.width;return!p||p==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[p]||"container-content"}),g=()=>{a("handleDelete",o.modelValue.id)},m=()=>{a("handleCopy",o.modelValue)},d=p=>{a("handlePaste",p)};return s(),(p,f)=>{var h,V,w,k,y,b,C,E;return e.openBlock(),e.createElementBlock(e.Fragment,null,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"informationLink_wrap",onMouseenter:f[3]||(f[3]=x=>r.value=!0),onMouseleave:f[4]||(f[4]=x=>r.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["media-image-full",u.value])},[e.createElementVNode("div",MX,[(V=(h=n.modelValue)==null?void 0:h.data)!=null&&V.link?(e.openBlock(),e.createElementBlock("div",OX,[(k=(w=n.modelValue)==null?void 0:w.data)!=null&&k.link?(e.openBlock(),e.createElementBlock("div",{key:0,target:"_blank",class:"information-link__btn btn p-0",onClick:f[0]||(f[0]=x=>{var N,$;return i(($=(N=n.modelValue)==null?void 0:N.data)==null?void 0:$.link)})},[e.createElementVNode("h6",{class:"information-link__title",innerHTML:(b=(y=n.modelValue)==null?void 0:y.data)==null?void 0:b.title},null,8,UX),f[6]||(f[6]=e.createElementVNode("div",{class:"i i-arrow-next"},null,-1))])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",RX,[e.createElementVNode("h6",{class:"information-link__title",innerHTML:(E=(C=n.modelValue)==null?void 0:C.data)==null?void 0:E.title},null,8,FX),f[7]||(f[7]=e.createElementVNode("div",{class:"i i-arrow-next"},null,-1))]))])],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:r.value,"onUpdate:show":f[1]||(f[1]=x=>r.value=x),onHandleEdit:f[2]||(f[2]=x=>c.value=!0),onHandleDelete:g,onHandleCopy:m,onHandlePaste:d},null,8,["show"]))],32)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(vX,{key:1,show:c.value,"onUpdate:show":f[5]||(f[5]=x=>c.value=x),data:n.modelValue},null,8,["show","data"]))],64)}}}),[["__scopeId","data-v-4f7843cf"]]),HX=Object.freeze(Object.defineProperty({__proto__:null,default:kc},Symbol.toStringTag,{value:"Module"})),jX={key:0,class:"tab-primary__btn__img flex-center"},zX=["src","alt"],qX={key:1},WX=ee({__name:"TabPrimary",props:{tabList:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:()=>0},isFixed:{type:Boolean,default:()=>!1},fullWidth:{type:Boolean,default:()=>!1}},emits:["updateCurrentIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:l,$vsScreenDestroyListener:s}=o,r=n,c=t,u=e.ref(null),g=e.ref(null),m=e.ref([]),d=e.ref(0),p=e.ref(.5*a.value),f=e.ref(0),h=e.ref(!0),V=e.ref(!0),w=e.ref(0),k=e.ref(!1),y=e.ref(0),b=e.ref(0),C=e.ref(0);e.ref(0);const E=e.ref(null),x=e.ref(null),N=e.ref(null),$=e.ref(null),S=e.ref(null),I=e.computed(()=>d.value-p.value),D=e.computed(()=>[{"--strip-width":`${I.value}px`},{"--strip-left":`${p.value}px`},{"--fix-left":`${f.value}px`},{transition:V.value?"left 0.2s ease-in-out, width 0.2s ease-in-out":""}]),A=e.computed(()=>y.value>0),O=e.computed(()=>b.value-y.value+Q.value>C.value),Q=e.computed(()=>{if(!k.value)return 24;const _e=u.value;return _e?window.getComputedStyle(_e,null).getPropertyValue("padding-right").split("px")[0]*2:24}),X=e.computed(()=>!1);e.watch(a,()=>{U(),R()}),e.watch(()=>r.currentIdx,(_e,le)=>{h.value=_e>le,e.nextTick(G),e.nextTick(J)}),e.watch(()=>r.tabList,(_e,le)=>{R(),e.nextTick(()=>{G(0)})},{deep:!0}),e.watch(()=>r.isFixed,()=>{a.value>1200&&U(),e.nextTick(R)});const G=_e=>{const le=_e??250;h.value?(M(),$.value=setTimeout(q,le)):(q(),$.value=setTimeout(M,le)),S.value=setTimeout(()=>{V.value=!0},le)},M=()=>{const _e=m.value;let le=null;_e&&_e[r.currentIdx]&&(le=_e[r.currentIdx]),le&&le.getBoundingClientRect&&(d.value=le.getBoundingClientRect().right)},q=()=>{const _e=m.value;let le=null;_e&&_e[r.currentIdx]&&(le=_e[r.currentIdx]),le&&le.getBoundingClientRect&&(p.value=le.getBoundingClientRect().left)},U=()=>{V.value=!1,e.nextTick(()=>G(0)),e.nextTick(H)},R=()=>{const _e=u.value;if(_e){let le=_e.getBoundingClientRect().left;f.value=(_e.offsetWidth-_e.getBoundingClientRect().width)/2+le}},H=()=>{var pe;if(!((pe=r.tabList)!=null&&pe.length))return;const _e=g.value;_e&&(y.value=_e.scrollLeft,b.value=_e.scrollWidth);const le=u.value;le&&(C.value=le.getBoundingClientRect().width)},j=_e=>{g.value&&(_e=="next"?g.value.scrollLeft+=9999:g.value.scrollLeft-=9999)},J=()=>{const _e=m.value[r.currentIdx];if(!_e)return;const le=_e.clientWidth/2,pe=a.value/2;w.value=_e.getBoundingClientRect().right-le,g.value&&(g.value.scrollLeft-=pe-w.value)},fe=(_e,le)=>{_e||c("updateCurrentIdx",le)},xe=_e=>_e?_e.includes("http")?"a":"RouterLink":"button",ne=_e=>_e&&!_e.includes("http")?_e:null,he=_e=>_e&&_e.includes("http")?_e:null,Ae=_e=>_e&&_e.includes("http")?"_blank":null;return e.onMounted(()=>{k.value=!0,e.nextTick(()=>{G(0),E.value=setTimeout(U,300),R(),e.nextTick(()=>{x.value=setTimeout(J,300)})})}),e.onBeforeUnmount(()=>{clearTimeout(E.value),clearTimeout(x.value),clearTimeout(N.value),clearTimeout($.value),clearTimeout(S.value),window.removeEventListener("resize",()=>{a.value=window.innerWidth})}),(_e,le)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-primary",[{"is-fixed":n.isFixed},{"is-campus":!X.value},{"is-full-width":n.fullWidth}]]),ref_key:"wrapper",ref:u},[e.createElementVNode("ul",{class:"tab-primary__list",ref_key:"list",ref:g,onScroll:U},[e.withDirectives(e.createElementVNode("div",{class:"tab-primary__nav__prev",onClick:le[0]||(le[0]=pe=>j("prev"))},null,512),[[e.vShow,A.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabList,(pe,se)=>(e.openBlock(),e.createElementBlock("li",{key:se,class:e.normalizeClass(["tab-primary__item",[{"is-img":!!pe.img}]])},[e.createElementVNode("div",{ref_for:!0,ref_key:"btnRefs",ref:m,class:"flex-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(xe(pe.link)),{type:pe.link?null:"button",to:ne(pe.link),href:he(pe.link),target:Ae(pe.link),class:e.normalizeClass(["tab-primary__btn",[{"is-active":n.currentIdx==se}]]),onClick:ge=>fe(pe.link,se)},{default:e.withCtx(()=>[pe.img?(e.openBlock(),e.createElementBlock("div",jX,[e.createElementVNode("img",{src:pe.img,alt:pe.alt||pe.name},null,8,zX)])):(e.openBlock(),e.createElementBlock("div",qX,e.toDisplayString(pe.name),1))]),_:2},1032,["type","to","href","target","class","onClick"]))],512)],2))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-primary__nav__next",onClick:le[1]||(le[1]=pe=>j("next"))},null,512),[[e.vShow,O.value]])],544),e.createElementVNode("span",{class:"tab-primary__strip",style:e.normalizeStyle(D.value)},null,4)],2))}},[["__scopeId","data-v-cb27de25"]]),GX={class:"setting-content"},XX={class:"setting-header flex items-center"},YX={class:"setting-body"},KX={class:"setting-toolbar"},QX={class:"tools"},ZX={class:"setting-item"},JX={class:"item-header"},eY={class:"btn-group"},tY={key:0,class:"drag-handle"},nY={class:"components-content"},oY={class:"setting-body"},aY={class:"setting-toolbar"},iY={class:"tools"},lY={class:"setting-item"},sY={class:"item-header"},rY={class:"btn-group"},dY={key:0,class:"drag-handle"},cY={class:"components-content"},uY=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),l=e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=d=>d&&d.length>1,r=n,c=t,u=()=>{c("update:show",!1)},g=d=>{var f;debugger;const p=r.data;d==="listAbove"?p.listAbove.push({id:F(),key:F(),name:"New Tab",componentsDataJson:[{id:((f=r.modelValue)==null?void 0:f.id)||F(),type:"BannerImage",onlyShowPc:!1,data:{title:"这里是标题",imgSrc:"https://osswebsite-test.cedim.cn/ywies-tx/static-images/about-ywies/01_About_YWIES_1_Header.jpg"}}]}):p.data.push({id:F(),key:F(),name:"New Tab",link:"",componentsDataJson:[]})},m=(d,p)=>{p==="listAbove"?r.data.listAbove=r.data.listAbove.filter(f=>f.id!==d):r.data.data=r.data.data.filter(f=>f.id!==d)};return(d,p)=>{const f=e.resolveComponent("a-switch"),h=e.resolveComponent("icon-plus"),V=e.resolveComponent("a-button"),w=e.resolveComponent("icon-drag-arrow"),k=e.resolveComponent("icon-delete"),y=e.resolveComponent("a-input"),b=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(b,{width:"60%",visible:n.show,footer:!1,onCancel:u,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",GX,[e.createElementVNode("div",XX,[p[13]||(p[13]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(f,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":p[0]||(p[0]=C=>n.data.onlyShowPc=C)},null,8,["modelValue"])]),e.createElementVNode("div",YX,[e.createElementVNode("div",KX,[p[16]||(p[16]=e.createElementVNode("h1",null,"List Above",-1)),e.createElementVNode("div",QX,[e.createVNode(V,{type:"primary",onClick:p[1]||(p[1]=C=>g("listAbove"))},{icon:e.withCtx(()=>[e.createVNode(h)]),default:e.withCtx(()=>[p[14]||(p[14]=e.createTextVNode(" 添加 List Above ",-1))]),_:1}),e.createVNode(V,{type:"primary",onClick:p[2]||(p[2]=C=>g("listAbove"))},{default:e.withCtx(()=>[...p[15]||(p[15]=[e.createTextVNode("粘贴 Tab",-1)])]),_:1})])]),e.createElementVNode("div",ZX,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.listAbove,"onUpdate:modelValue":p[4]||(p[4]=C=>n.data.listAbove=C),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},l.value,{disabled:!s(n.data.data),onStart:p[5]||(p[5]=C=>a.value=!0),onEnd:p[6]||(p[6]=C=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:C})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!s(n.data.data)}]),key:C.id},[e.createElementVNode("div",JX,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(C.name),1),e.createElementVNode("span",null,e.toDisplayString(C.key),1)]),e.createElementVNode("div",eY,[s(n.data.data)?(e.openBlock(),e.createElementBlock("div",tY,[e.createVNode(w,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(k,{class:"btn-delete",onClick:E=>m(C.id,"listAbove")},null,8,["onClick"]),e.createVNode(V,{size:"mini",type:"primary",onClick:p[3]||(p[3]=E=>g("Video"))},{default:e.withCtx(()=>[...p[17]||(p[17]=[e.createTextVNode("复制 Tab",-1)])]),_:1})])]),p[18]||(p[18]=e.createElementVNode("p",{class:"item-title"},"Tab名称",-1)),e.createVNode(y,{modelValue:C.name,"onUpdate:modelValue":E=>C.name=E,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[19]||(p[19]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(y,{modelValue:C.key,"onUpdate:modelValue":E=>C.key=E,placeholder:"请输入key","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[20]||(p[20]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",nY,[e.createVNode(Fa,{data:C.componentsDataJson,onUpdate:E=>C.componentsDataJson=E},null,8,["data","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])]),e.createElementVNode("div",oY,[e.createElementVNode("div",aY,[p[23]||(p[23]=e.createElementVNode("h1",null,"List",-1)),e.createElementVNode("div",iY,[e.createVNode(V,{type:"primary",onClick:p[7]||(p[7]=C=>g("Video"))},{icon:e.withCtx(()=>[e.createVNode(h)]),default:e.withCtx(()=>[p[21]||(p[21]=e.createTextVNode(" 添加 List ",-1))]),_:1}),e.createVNode(V,{type:"primary",onClick:p[8]||(p[8]=C=>g("Video"))},{default:e.withCtx(()=>[...p[22]||(p[22]=[e.createTextVNode("粘贴 Tab",-1)])]),_:1})])]),e.createElementVNode("div",lY,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":p[10]||(p[10]=C=>n.data.data=C),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!s(n.data.data),onStart:p[11]||(p[11]=C=>a.value=!0),onEnd:p[12]||(p[12]=C=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:C})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!s(n.data.data)}]),key:C.id},[e.createElementVNode("div",sY,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(C.name),1),e.createElementVNode("span",null,e.toDisplayString(C.key),1)]),e.createElementVNode("div",rY,[s(n.data.data)?(e.openBlock(),e.createElementBlock("div",dY,[e.createVNode(w,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(k,{class:"btn-delete",onClick:E=>m(C.id,"list")},null,8,["onClick"]),e.createVNode(V,{size:"mini",type:"primary",onClick:p[9]||(p[9]=E=>g("Video"))},{default:e.withCtx(()=>[...p[24]||(p[24]=[e.createTextVNode("复制 Tab",-1)])]),_:1})])]),p[25]||(p[25]=e.createElementVNode("p",{class:"item-title"},"Tab名称",-1)),e.createVNode(y,{modelValue:C.name,"onUpdate:modelValue":E=>C.name=E,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[26]||(p[26]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(y,{modelValue:C.key,"onUpdate:modelValue":E=>C.key=E,placeholder:"请输入key","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[27]||(p[27]=e.createElementVNode("p",{class:"item-title"},"Link",-1)),e.createVNode(y,{modelValue:C.link,"onUpdate:modelValue":E=>C.link=E,placeholder:"请输入link","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[28]||(p[28]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",cY,[e.createVNode(Fa,{data:C.componentsDataJson,onUpdate:E=>C.componentsDataJson=E},null,8,["data","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-63c63489"]]),mY={class:"tab-page__above"},pY={key:0},hY={key:0},fY={class:"tab-page__content"},gY={key:0},yY="",Ec=ee({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:""}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=t,{proxy:a}=e.getCurrentInstance(),{$_vsWidth:i,$_vsScrollY:l,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=a,c=n,u=e.ref(0),g=e.ref(!1),m=e.ref(!0),d=e.ref(null),p=e.ref(null),f=e.ref(!1),h=e.ref(!1),V=H=>{if(!H)return{top:0,left:0};const j=H.getBoundingClientRect(),J=window.pageYOffset||document.documentElement.scrollTop,fe=window.pageXOffset||document.documentElement.scrollLeft;return{top:j.top+J,left:j.left+fe}},w=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.classes)??null}),k=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.style)??null});e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.type)??"TabPrimary"});const y=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.listAbove)??[]}),b=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.data)??[]}),C=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.fixed)??!0}),E=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.resetToTop)??!0}),x=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.scrollToTop)??!0}),N=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.fullWidth)??!1});e.computed(()=>0),e.computed(()=>!1);const $=e.computed(()=>b.value.some(H=>H.img)),S=e.computed(()=>{var H;return((H=b.value[u.value])==null?void 0:H.key)??null}),I=e.computed(()=>{var j;if(!((j=c.modelValue)!=null&&j.data)||!Array.isArray(c.modelValue.data))return[];const H=c.modelValue.data[u.value];return H?H.componentsDataJson||[]:[]}),D=e.ref(""),A=()=>{var j,J;if(c.modelValue&&c.modelValue.data){const fe=window==null?void 0:window.location.pathname.split("#")[0].split("/");D.value=((j=window==null?void 0:window.location.pathname.split("#"))==null?void 0:j[1])||"",D.value&&setTimeout(()=>{X()},1e3);const xe=fe[fe.length-1];u.value=b.value.findIndex(ne=>ne.key===xe)||0;return}const H={id:((J=c.modelValue)==null?void 0:J.id)||F(),type:"TabPage",onlyShowPc:!1,containerWidth:"",bgColor:"",classes:"custom-class another-class",style:{},width:"",listAbove:[],data:[{id:F(),key:F(),name:"New Tab1",componentsDataJson:[]},{id:F(),key:F(),name:"New Tab2",componentsDataJson:[]}]};o("update:modelValue",H),u.value=0},O=()=>{var ne,he;const H=p.value;if(!H)return;const j=H.getBoundingClientRect().top,J=d.value;if(!J)return;const fe=J.getBoundingClientRect().top,xe=+((he=(ne=window.getComputedStyle(document.body))==null?void 0:ne.getPropertyValue("--header-height-calc"))==null?void 0:he.split("px")[0])||0;if(fe>xe){g.value=!1;return}j<=xe&&(g.value=!0)},Q=()=>{if(!x.value)return;let H=0;E.value||(H=V(d.value).top-170),window.scroll({top:H,left:0,behavior:"smooth"})},X=()=>{if(!D.value)return;const H=document.querySelector(D.value);if(!H)return;const j=V(H).top;window.scroll({top:j-170,left:0,behavior:"smooth"})},G=H=>{sessionStorage.setItem(yY,H)},M=(H,j)=>{debugger;o("handleDelete",H||c.modelValue.id,j)},q=H=>{debugger;o("handleCopy",H||c.modelValue)},U=(H,j,J)=>{debugger;o("handlePaste",H,j,J)},R=H=>{o("handleClick",H)};return e.watch(()=>l.value,()=>{O()}),e.watch(u,()=>{G(S.value),m.value&&Q(),m.value=!0}),e.watch(S,H=>{H||(u.value=0)}),e.onMounted(()=>{A(),e.nextTick(O),setTimeout(()=>{e.nextTick(O)},200),setTimeout(()=>{},1e3)}),(H,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-page",w.value]),style:e.normalizeStyle(k.value),onMouseover:j[8]||(j[8]=J=>h.value=!0),onMouseout:j[9]||(j[9]=J=>h.value=!1)},[e.createElementVNode("div",mY,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[S.value?(e.openBlock(),e.createElementBlock("div",pY,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(J,fe)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:J.key},[S.value==J.key?(e.openBlock(),e.createElementBlock("div",hY,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.componentsDataJson,(xe,ne)=>(e.openBlock(),e.createBlock(Co,{key:xe.id,hash:xe.hash,type:xe.type,"props-data":{modelValue:xe,isPreview:n.isPreview,host:n.host,locale:n.locale},onHandleDelete:j[0]||(j[0]=he=>M(he,I.value)),onHandleCopy:j[1]||(j[1]=he=>q(he)),onHandlePaste:he=>U(he,I.value,ne),onHandleClick:R},null,8,["hash","type","props-data","onHandlePaste"]))),128))])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["tab-page__hold",[{"is-fixed":g.value&&C.value},{"is-thick":$.value}]]),ref_key:"hold",ref:d},[e.createElementVNode("div",{class:"tab-page__nav",ref_key:"tab",ref:p},[e.createVNode(WX,{tabList:b.value,currentIdx:u.value,isFixed:g.value&&C.value,fullWidth:N.value,onUpdateCurrentIdx:j[2]||(j[2]=J=>u.value=J)},null,8,["tabList","currentIdx","isFixed","fullWidth"])],512)],2),e.createElementVNode("div",fY,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[S.value?(e.openBlock(),e.createElementBlock("div",{key:S.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,J=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[S.value==J.key?(e.openBlock(),e.createElementBlock("div",gY,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.componentsDataJson,(fe,xe)=>(e.openBlock(),e.createBlock(Co,{key:fe.id,type:fe.type,"props-data":{modelValue:fe,isPreview:n.isPreview,host:n.host,locale:n.locale},onHandleDelete:j[3]||(j[3]=ne=>M(ne,I.value)),onHandleCopy:j[4]||(j[4]=ne=>q(ne)),onHandlePaste:ne=>U(ne,I.value,xe),onHandleClick:R},null,8,["type","props-data","onHandlePaste"]))),128))])):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)]),_:1})]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:h.value,"onUpdate:show":j[5]||(j[5]=J=>h.value=J),onHandleEdit:j[6]||(j[6]=J=>f.value=!0),onHandleDelete:M,onHandleCopy:q,onHandlePaste:U,style:{top:"-22px"}},null,8,["show"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(uY,{key:1,show:f.value,"onUpdate:show":j[7]||(j[7]=J=>f.value=J),data:n.modelValue},null,8,["show","data"]))],38))}},[["__scopeId","data-v-b9886d7e"]]),_Y=Object.freeze(Object.defineProperty({__proto__:null,default:Ec},Symbol.toStringTag,{value:"Module"})),wY={class:"tab-logo__btn__img flex-center"},bY=["src","alt"],CY=ee({__name:"TabLogo",props:{tabList:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0},isFixed:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1}},emits:["updateCurrentIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:l,$vsScreenDestroyListener:s}=o,r=n,c=t,u=e.ref(0),g=e.ref(.5*a.value),m=e.ref(0),d=e.ref(!0),p=e.ref(!0),f=e.ref(0),h=e.ref(!1),V=e.ref(0),w=e.ref(0),k=e.ref(0),y=e.ref(null),b=e.ref(null),C=e.ref([]),E=H=>H||"",x=e.computed(()=>u.value-g.value),N=e.computed(()=>[{"--strip-width":`${x.value}px`},{"--strip-left":`${g.value}px`},{"--fix-left":`${m.value}px`},{transition:p.value?"left 0.2s ease-in-out, width 0.2s ease-in-out":""}]),$=e.computed(()=>V.value>0),S=e.computed(()=>w.value-V.value+I.value>k.value),I=e.computed(()=>{if(!h.value)return 24;const H=y.value;if(!H)return 24;const j=window.getComputedStyle(H,null).getPropertyValue("padding-right").split("px")[0];return Number(j)*2}),D=e.computed(()=>!1);e.watch(a,()=>{X(),G()}),e.watch(()=>r.currentIdx,(H,j)=>{d.value=H>j,e.nextTick(()=>A()),e.nextTick(()=>U())}),e.watch(()=>r.isFixed,()=>{a.value>1200&&X(),e.nextTick(()=>G())}),e.watch(()=>r.tabList,(H,j)=>{G(),e.nextTick(()=>{A(0)})},{deep:!0});const A=H=>{const j=H??250;d.value?(O(),setTimeout(Q,j)):(Q(),setTimeout(O,j)),setTimeout(()=>{p.value=!0},j)},O=()=>{const H=C.value[r.currentIdx];H&&H.getBoundingClientRect&&(u.value=H.getBoundingClientRect().right)},Q=()=>{const H=C.value[r.currentIdx];H&&H.getBoundingClientRect&&(g.value=H.getBoundingClientRect().left)},X=()=>{p.value=!1,e.nextTick(()=>A(0)),e.nextTick(()=>M())},G=()=>{const H=y.value;if(H){let j=H.getBoundingClientRect().left;m.value=(H.offsetWidth-H.getBoundingClientRect().width)/2-j}},M=()=>{var H;(H=r.tabList)!=null&&H.length&&(b.value&&(V.value=b.value.scrollLeft,w.value=b.value.scrollWidth),y.value&&(k.value=y.value.getBoundingClientRect().width))},q=H=>{b.value&&(H=="next"?b.value.scrollLeft+=9999:b.value.scrollLeft-=9999)},U=()=>{const H=C.value[r.currentIdx];if(!H)return;const j=H.clientWidth/2,J=a.value/2;f.value=H.getBoundingClientRect().right-j,b.value&&(b.value.scrollLeft-=J-f.value)},R=H=>{c("updateCurrentIdx",H)};return e.onMounted(()=>{h.value=!0,e.nextTick(()=>{A(0),setTimeout(X,300),G(),e.nextTick(()=>{setTimeout(U,300)})})}),(H,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-logo",[{"is-fixed":n.isFixed},{"is-campus":!D.value},{"is-full-width":n.fullWidth}]]),ref_key:"wrapper",ref:y},[e.createElementVNode("ul",{class:"tab-logo__list",ref_key:"list",ref:b,onScroll:X},[e.withDirectives(e.createElementVNode("div",{class:"tab-logo__nav__prev",onClick:j[0]||(j[0]=J=>q("prev"))},null,512),[[e.vShow,$.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabList,(J,fe)=>(e.openBlock(),e.createElementBlock("li",{key:fe,class:e.normalizeClass(["tab-logo__item",[{"tab-logo__item--img":!!J.img}]])},[e.createElementVNode("div",{ref_for:!0,ref_key:"btn",ref:C,class:"flex-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(J.link?"nuxt-link":"button"),{type:J.link?null:"button",to:E(J.link),class:e.normalizeClass(["tab-logo__btn",[{"is-active":n.currentIdx==fe}]]),onClick:xe=>R(fe)},{default:e.withCtx(()=>[e.createElementVNode("div",wY,[e.createElementVNode("img",{src:J.img,alt:J.alt},null,8,bY)])]),_:2},1032,["type","to","class","onClick"]))],512)],2))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-logo__nav__next",onClick:j[1]||(j[1]=J=>q("next"))},null,512),[[e.vShow,S.value]])],544),e.createElementVNode("span",{class:"tab-logo__strip",style:e.normalizeStyle(N.value)},null,4)],2))}},[["__scopeId","data-v-b6353647"]]),VY={class:"setting-content"},xY={class:"setting-header flex items-center"},kY={class:"setting-body"},EY={class:"setting-toolbar"},TY={class:"tools"},NY={class:"setting-item"},SY={class:"item-header"},BY={class:"btn-group"},PY={key:0,class:"drag-handle"},DY=["src"],$Y={class:"item-uplaod flex items-center"},LY={class:"components-content"},AY=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1}));e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1}));const l=m=>m&&m.length>1,s=n,r=t,c=()=>{r("update:show",!1)},u=m=>{debugger;s.data.data.push({id:F(),key:F(),name:"New Tab",img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:"yew-chung-international-school",componentsDataJson:[]})},g=(m,d)=>{s.data.data=s.data.data.filter(p=>p.id!==m)};return(m,d)=>{const p=e.resolveComponent("a-switch"),f=e.resolveComponent("icon-plus"),h=e.resolveComponent("a-button"),V=e.resolveComponent("icon-drag-arrow"),w=e.resolveComponent("icon-delete"),k=e.resolveComponent("a-input"),y=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(y,{width:"60%",visible:n.show,footer:!1,onCancel:c,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",VY,[e.createElementVNode("div",xY,[d[7]||(d[7]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(p,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":d[0]||(d[0]=b=>n.data.onlyShowPc=b)},null,8,["modelValue"])]),e.createElementVNode("div",kY,[e.createElementVNode("div",EY,[d[10]||(d[10]=e.createElementVNode("h1",null,"List",-1)),e.createElementVNode("div",TY,[e.createVNode(h,{type:"primary",onClick:d[1]||(d[1]=b=>u())},{icon:e.withCtx(()=>[e.createVNode(f)]),default:e.withCtx(()=>[d[8]||(d[8]=e.createTextVNode(" 添加 List ",-1))]),_:1}),e.createVNode(h,{type:"primary",onClick:d[2]||(d[2]=b=>u())},{default:e.withCtx(()=>[...d[9]||(d[9]=[e.createTextVNode("粘贴 Tab",-1)])]),_:1})])]),e.createElementVNode("div",NY,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":d[4]||(d[4]=b=>n.data.data=b),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!l(n.data.data),onStart:d[5]||(d[5]=b=>a.value=!0),onEnd:d[6]||(d[6]=b=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:b})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!l(n.data.data)}]),key:b.id},[e.createElementVNode("div",SY,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(b.name),1),e.createElementVNode("span",null,e.toDisplayString(b.key),1)]),e.createElementVNode("div",BY,[l(n.data.data)?(e.openBlock(),e.createElementBlock("div",PY,[e.createVNode(V,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(w,{class:"btn-delete",onClick:C=>g(b.id)},null,8,["onClick"]),e.createVNode(h,{size:"mini",type:"primary",onClick:d[3]||(d[3]=C=>u())},{default:e.withCtx(()=>[...d[11]||(d[11]=[e.createTextVNode("复制 Tab",-1)])]),_:1})])]),d[12]||(d[12]=e.createElementVNode("p",{class:"item-title"},"Alt",-1)),e.createVNode(k,{modelValue:b.alt,"onUpdate:modelValue":C=>b.alt=C,placeholder:"请输入alt","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),d[13]||(d[13]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(k,{modelValue:b.key,"onUpdate:modelValue":C=>b.key=C,placeholder:"请输入key","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),d[14]||(d[14]=e.createElementVNode("p",{class:"item-title"},"图片",-1)),e.createElementVNode("img",{class:"item-img",src:b.img},null,8,DY),e.createElementVNode("div",$Y,[e.createVNode(k,{modelValue:b.img,"onUpdate:modelValue":C=>b.img=C,placeholder:"请输入图片链接","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(je,{modelValue:b.img,"onUpdate:modelValue":C=>b.img=C,name:b.key},null,8,["modelValue","onUpdate:modelValue","name"])]),d[15]||(d[15]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",LY,[e.createVNode(Fa,{data:b.componentsDataJson,onUpdate:C=>b.componentsDataJson=C},null,8,["data","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-c52189f2"]]),IY={class:"tab-page__content"},vY={key:0},MY={style:{position:"relative"}},OY="",Tc=ee({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:""}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=t,{proxy:a}=e.getCurrentInstance(),{$_vsWidth:i,$_vsScrollY:l,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=a,c=n,u=e.ref(0),g=e.ref(!1),m=e.ref(!0),d=e.ref(null),p=e.ref(null),f=e.ref(!1),h=e.ref(!1),V=q=>{if(!q)return{top:0,left:0};const U=q.getBoundingClientRect(),R=window.pageYOffset||document.documentElement.scrollTop,H=window.pageXOffset||document.documentElement.scrollLeft;return{top:U.top+R,left:U.left+H}},w=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.classes)??null}),k=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.style)??null});e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.type)??"TabPrimary"});const y=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.data)??[]}),b=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.fixed)??!0}),C=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.resetToTop)??!0}),E=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.scrollToTop)??!0}),x=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.fullWidth)??!1});e.computed(()=>0),e.computed(()=>!1);const N=e.computed(()=>y.value.some(q=>q.img)),$=e.computed(()=>{var q;return((q=y.value[u.value])==null?void 0:q.key)??null}),S=e.computed(()=>{var U;if(!((U=c.modelValue)!=null&&U.data)||!Array.isArray(c.modelValue.data))return[];const q=c.modelValue.data[u.value];return q?q.componentsDataJson||[]:[]}),I=()=>{var U;if(c.modelValue&&c.modelValue.data)return;const q={id:((U=c.modelValue)==null?void 0:U.id)||F(),type:"TabLogo",onlyShowPc:!1,containerWidth:"",bgColor:"",classes:"custom-class another-class",style:{},width:"",resetToTop:!1,fullWidth:!0,fixed:!1,scrollToTop:!1,data:[{id:F(),key:F(),img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:"yew-chung-international-school",name:"New Tab1",componentsDataJson:[]},{id:F(),key:F(),img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:"yew-chung-international-school",name:"New Tab2",componentsDataJson:[]}]};o("update:modelValue",q),u.value=0},D=()=>{var J,fe;const q=p.value;if(!q)return;const U=q.getBoundingClientRect().top,R=d.value;if(!R)return;const H=R.getBoundingClientRect().top,j=+((fe=(J=window.getComputedStyle(document.body))==null?void 0:J.getPropertyValue("--header-height-calc"))==null?void 0:fe.split("px")[0])||0;if(H>j){g.value=!1;return}U<=j&&(g.value=!0)},A=()=>{if(!E.value)return;let q=0;C.value||(q=V(d.value).top-170),window.scroll({top:q,left:0,behavior:"smooth"})},O=q=>{sessionStorage.setItem(OY,q)},Q=(q,U)=>{debugger;o("handleDelete",q||c.modelValue.id,U)},X=q=>{debugger;o("handleCopy",q||c.modelValue)},G=(q,U,R)=>{debugger;o("handlePaste",q,U,R)},M=q=>{o("handleClick",q)};return e.watch(()=>l.value,()=>{D()}),e.watch(u,()=>{O($.value),m.value&&A(),m.value=!0}),e.watch($,q=>{q||(u.value=0)}),e.onMounted(()=>{I(),e.nextTick(D),setTimeout(()=>{e.nextTick(D)},200),setTimeout(()=>{},1e3)}),(q,U)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-page",w.value]),style:e.normalizeStyle(k.value),onMouseover:U[6]||(U[6]=R=>h.value=!0),onMouseout:U[7]||(U[7]=R=>h.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["tab-page__hold",[{"is-fixed":g.value&&b.value},{"is-thick":N.value}]]),ref_key:"hold",ref:d},[e.createElementVNode("div",{class:"tab-page__nav",ref_key:"tab",ref:p},[e.createVNode(CY,{tabList:y.value,currentIdx:u.value,isFixed:g.value&&b.value,fullWidth:x.value,onUpdateCurrentIdx:U[0]||(U[0]=R=>u.value=R)},null,8,["tabList","currentIdx","isFixed","fullWidth"])],512)],2),e.createElementVNode("div",IY,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[$.value?(e.openBlock(),e.createElementBlock("div",{key:$.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,R=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[$.value==R.key?(e.openBlock(),e.createElementBlock("div",vY,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.componentsDataJson,(H,j)=>(e.openBlock(),e.createElementBlock("div",MY,[(e.openBlock(),e.createBlock(Co,{key:H.id,type:H.type,"props-data":{modelValue:H,isPreview:n.isPreview,host:n.host,locale:n.locale},onHandleDelete:U[1]||(U[1]=J=>Q(J,S.value)),onHandleCopy:U[2]||(U[2]=J=>X(J)),onHandlePaste:J=>G(J,S.value,j),onHandleClick:M},null,8,["type","props-data","onHandlePaste"]))]))),256))])):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)]),_:1})]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:h.value,"onUpdate:show":U[3]||(U[3]=R=>h.value=R),onHandleEdit:U[4]||(U[4]=R=>f.value=!0),onHandleDelete:Q,onHandleCopy:X,onHandlePaste:G,style:{top:"-22px"}},null,8,["show"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(AY,{key:1,show:f.value,"onUpdate:show":U[5]||(U[5]=R=>f.value=R),data:n.modelValue},null,8,["show","data"]))],38))}},[["__scopeId","data-v-d38408e9"]]),UY=Object.freeze(Object.defineProperty({__proto__:null,default:Tc},Symbol.toStringTag,{value:"Module"})),RY={class:"setting-content"},FY={class:"setting-header flex items-center"},HY={class:"setting-header flex items-center"},jY={class:"setting-header flex items-center"},zY={class:"setting-header flex items-center"},qY={class:"setting-header flex items-center"},WY={class:"setting-header flex items-center"},GY={class:"preview-container"},XY=["src"],YY={key:1,class:"no-preview"},KY={class:"setting-body"},QY={class:"setting-item"},ZY={class:"components-content"},JY=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=n,a=e.ref([{id:"preset-1",name:"YCCECE Background 1",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-01.svg",size:"cover",position:"center center"},{id:"preset-2",name:"YCCECE Background 2",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-02.svg",size:"",position:""},{id:"preset-3",name:"YCCECE Background 3",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-03.svg",size:"cover",position:""},{id:"preset-4",name:"YCCECE Background 4",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-04.svg",size:"cover",position:""}]),i=e.ref(),l=a.value.find(u=>u.image===o.data.backgroundImage);i.value=l?l.id:"";const s=()=>{const u=a.value.find(g=>g.id===i.value);u&&(o.data.backgroundImage=`${u.image}`,o.data.backgroundSize=u.size,o.data.backgroundPosition=u.position)},r=t,c=()=>{r("update:show",!1)};return(u,g)=>{const m=e.resolveComponent("a-switch"),d=e.resolveComponent("a-option"),p=e.resolveComponent("a-select"),f=e.resolveComponent("a-button"),h=e.resolveComponent("a-input"),V=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(V,{width:"60%",visible:n.show,footer:!1,onCancel:c,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",RY,[e.createElementVNode("div",FY,[g[6]||(g[6]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(m,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":g[0]||(g[0]=w=>n.data.onlyShowPc=w)},null,8,["modelValue"])]),e.createElementVNode("div",HY,[g[8]||(g[8]=e.createElementVNode("span",{class:"header-title"},"Background Preset",-1)),e.createVNode(p,{modelValue:i.value,"onUpdate:modelValue":g[1]||(g[1]=w=>i.value=w),style:{width:"300px","margin-right":"8px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,w=>(e.openBlock(),e.createBlock(d,{value:w.id,key:w.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(f,{type:"primary",onClick:s},{default:e.withCtx(()=>[...g[7]||(g[7]=[e.createTextVNode("Apply",-1)])]),_:1})]),e.createElementVNode("div",jY,[g[9]||(g[9]=e.createElementVNode("span",{class:"header-title"},"Image",-1)),e.createVNode(h,{modelValue:n.data.backgroundImage,"onUpdate:modelValue":g[2]||(g[2]=w=>n.data.backgroundImage=w),disabled:!0,placeholder:"图片路径",style:{width:"300px"}},null,8,["modelValue"])]),e.createElementVNode("div",zY,[g[10]||(g[10]=e.createElementVNode("span",{class:"header-title"},"Size",-1)),e.createVNode(h,{modelValue:n.data.backgroundSize,"onUpdate:modelValue":g[3]||(g[3]=w=>n.data.backgroundSize=w),disabled:!0,placeholder:"尺寸",style:{width:"300px"}},null,8,["modelValue"])]),e.createElementVNode("div",qY,[g[11]||(g[11]=e.createElementVNode("span",{class:"header-title"},"Position",-1)),e.createVNode(h,{modelValue:n.data.backgroundPosition,"onUpdate:modelValue":g[4]||(g[4]=w=>n.data.backgroundPosition=w),disabled:!0,placeholder:"位置",style:{width:"300px"}},null,8,["modelValue"])]),e.createElementVNode("div",WY,[g[13]||(g[13]=e.createElementVNode("span",{class:"header-title"},"Preview",-1)),e.createElementVNode("div",GY,[n.data.backgroundImage?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.data.backgroundImage,style:e.normalizeStyle({"object-fit":n.data.backgroundSize||"cover","background-position":n.data.backgroundPosition||"center center",width:"100%",height:"100px",border:"1px solid #ddd"}),alt:"Background Preview"},null,12,XY)):(e.openBlock(),e.createElementBlock("div",YY,"No preview available")),g[12]||(g[12]=e.createElementVNode("p",{class:"preview-note"}," A light grey background has been applied for previewing and will not be reflected on website. ",-1))])]),e.createElementVNode("div",KY,[g[14]||(g[14]=e.createElementVNode("div",{class:"setting-toolbar"},[e.createElementVNode("h4",null,"组件")],-1)),e.createElementVNode("div",QY,[e.createElementVNode("div",ZY,[e.createVNode(Fa,{data:n.data.data,onUpdate:g[5]||(g[5]=w=>n.data.data=w)},null,8,["data"])])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-f43efd7b"]]),eK={class:"component-wrapper"},Nc=ee({__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:""}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,a=t,i=e.computed(()=>{var C,E;return!((C=o.modelValue)!=null&&C.data)||!Array.isArray(o.modelValue.data)?[]:(E=o.modelValue)==null?void 0:E.data}),l=(C,E)=>{debugger;a("handleDelete",C||o.modelValue.id,E)},s=C=>{debugger;a("handleCopy",C||o.modelValue)},r=(C,E,x)=>{debugger;a("handlePaste",C,E,x)},c=C=>{a("handleClick",C)},u=e.ref(!1),g=e.ref(!1),m=()=>{var E,x;if(o.modelValue&&o.modelValue.data)return;const C={id:((E=o.modelValue)==null?void 0:E.id)||F(),type:"BackgroundWrapper",onlyShowPc:!1,backgroundImage:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-01.svg",backgroundSize:"cover",backgroundPosition:"center center",data:[{id:((x=o.modelValue)==null?void 0:x.id)||F(),type:"CustomText",onlyShowPc:!1,data:{width:1920,backgroundColor:"#ffffff",title:"这是标题",description:"这是描述"}}]};a("update:modelValue",C)},d=e.computed(()=>{var C;return o.isPreview?!((C=o.modelValue)!=null&&C.onlyShowPc)||!Ne():!0}),p=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.classes)??null}),f=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.style)??null}),h=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.width)??null}),V=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.backgroundImage)??""}),w=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.backgroundColor)??"transparent"}),k=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.backgroundSize)??"contain"}),y=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.backgroundPosition)??"center"}),b=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.backgroundRepeat)??"no-repeat"});return m(),(C,E)=>d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["background-wrapper",p.value]),style:e.normalizeStyle(f.value)},[e.createElementVNode("div",{class:e.normalizeClass(h.value),style:{position:"relative"},onMouseover:E[4]||(E[4]=x=>u.value=!0),onMouseout:E[5]||(E[5]=x=>u.value=!1)},[e.createElementVNode("div",{class:"background-wrapper__bg",style:e.normalizeStyle({"background-image":`url('${V.value}')`,"background-color":`${w.value}`,"background-size":`${k.value}`,"background-position":`${y.value}`,"background-repeat":`${b.value}`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(x,N)=>(e.openBlock(),e.createElementBlock("div",{key:x.id,class:"page-item"},[e.createElementVNode("div",eK,[e.createVNode(Co,{type:x.type,"props-data":{modelValue:x,isPreview:n.isPreview,host:n.host,locale:n.locale},onHandleDelete:E[0]||(E[0]=$=>l($,i.value)),onHandleCopy:E[1]||(E[1]=$=>s($)),onHandlePaste:$=>r($,i.value,N),onHandleClick:c},null,8,["type","props-data","onHandlePaste"])])]))),128))],4),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:u.value,"onUpdate:show":E[2]||(E[2]=x=>u.value=x),onHandleEdit:E[3]||(E[3]=x=>g.value=!0),onHandleDelete:l,onHandleCopy:s,onHandlePaste:r},null,8,["show"]))],34),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(JY,{key:0,show:g.value,"onUpdate:show":E[6]||(E[6]=x=>g.value=x),data:n.modelValue},null,8,["show","data"]))],6)):e.createCommentVNode("",!0)}},[["__scopeId","data-v-ded0ec5a"]]),tK=Object.freeze(Object.defineProperty({__proto__:null,default:Nc},Symbol.toStringTag,{value:"Module"}));var oy="Expected a function",ay=NaN,nK="[object Symbol]",oK=/^\s+|\s+$/g,aK=/^[-+]0x[0-9a-f]+$/i,iK=/^0b[01]+$/i,lK=/^0o[0-7]+$/i,sK=parseInt,rK=typeof ca=="object"&&ca&&ca.Object===Object&&ca,dK=typeof self=="object"&&self&&self.Object===Object&&self,cK=rK||dK||Function("return this")(),uK=Object.prototype,mK=uK.toString,pK=Math.max,hK=Math.min,Np=function(){return cK.Date.now()};function fK(n,t,o){var a,i,l,s,r,c,u=0,g=!1,m=!1,d=!0;if(typeof n!="function")throw new TypeError(oy);t=iy(t)||0,Sc(o)&&(g=!!o.leading,m="maxWait"in o,l=m?pK(iy(o.maxWait)||0,t):l,d="trailing"in o?!!o.trailing:d);function p(E){var x=a,N=i;return a=i=void 0,u=E,s=n.apply(N,x),s}function f(E){return u=E,r=setTimeout(w,t),g?p(E):s}function h(E){var x=E-c,N=E-u,$=t-x;return m?hK($,l-N):$}function V(E){var x=E-c,N=E-u;return c===void 0||x>=t||x<0||m&&N>=l}function w(){var E=Np();if(V(E))return k(E);r=setTimeout(w,h(E))}function k(E){return r=void 0,d&&a?p(E):(a=i=void 0,s)}function y(){r!==void 0&&clearTimeout(r),u=0,a=c=i=r=void 0}function b(){return r===void 0?s:k(Np())}function C(){var E=Np(),x=V(E);if(a=arguments,i=this,c=E,x){if(r===void 0)return f(c);if(m)return r=setTimeout(w,t),p(c)}return r===void 0&&(r=setTimeout(w,t)),s}return C.cancel=y,C.flush=b,C}function gK(n,t,o){var a=!0,i=!0;if(typeof n!="function")throw new TypeError(oy);return Sc(o)&&(a="leading"in o?!!o.leading:a,i="trailing"in o?!!o.trailing:i),fK(n,t,{leading:a,maxWait:t,trailing:i})}function Sc(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function yK(n){return!!n&&typeof n=="object"}function _K(n){return typeof n=="symbol"||yK(n)&&mK.call(n)==nK}function iy(n){if(typeof n=="number")return n;if(_K(n))return ay;if(Sc(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Sc(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(oK,"");var o=iK.test(n);return o||lK.test(n)?sK(n.slice(2),o?2:8):aK.test(n)?ay:+n}var wK=gK;const bK=Ua(wK),CK={class:"setting-content"},VK={class:"setting-header flex items-center"},xK={class:"setting-header flex items-center"},kK={class:"setting-header flex items-center"},EK={class:"setting-header flex items-center"},TK={class:"setting-body"},NK={class:"setting-item"},SK={class:"components-content"},BK=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){e.defineAsyncComponent(()=>import("vuedraggable"));const o=t,a=()=>{o("update:show",!1)};return(i,l)=>{const s=e.resolveComponent("a-switch"),r=e.resolveComponent("a-input"),c=e.resolveComponent("a-option"),u=e.resolveComponent("a-select"),g=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(g,{width:"60%",visible:n.show,footer:!1,onCancel:a,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",CK,[e.createElementVNode("div",VK,[l[5]||(l[5]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(s,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":l[0]||(l[0]=m=>n.data.onlyShowPc=m)},null,8,["modelValue"])]),e.createElementVNode("div",xK,[l[6]||(l[6]=e.createElementVNode("span",{class:"header-title"},"标题",-1)),e.createVNode(r,{modelValue:n.data.title,"onUpdate:modelValue":l[1]||(l[1]=m=>n.data.title=m),placeholder:"请输入标题","allow-clear":""},null,8,["modelValue"])]),e.createElementVNode("div",kK,[l[11]||(l[11]=e.createElementVNode("span",{class:"header-title"},"组件宽度",-1)),e.createVNode(u,{modelValue:n.data.width,"onUpdate:modelValue":l[2]||(l[2]=m=>n.data.width=m),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode(c,{value:""},{default:e.withCtx(()=>[...l[7]||(l[7]=[e.createTextVNode("默认",-1)])]),_:1}),e.createVNode(c,{value:"small"},{default:e.withCtx(()=>[...l[8]||(l[8]=[e.createTextVNode("小",-1)])]),_:1}),e.createVNode(c,{value:"middle"},{default:e.withCtx(()=>[...l[9]||(l[9]=[e.createTextVNode("中",-1)])]),_:1}),e.createVNode(c,{value:"max"},{default:e.withCtx(()=>[...l[10]||(l[10]=[e.createTextVNode("大",-1)])]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",EK,[l[14]||(l[14]=e.createElementVNode("span",{class:"header-title"},"Opened by default",-1)),e.createVNode(u,{modelValue:n.data.openFirst,"onUpdate:modelValue":l[3]||(l[3]=m=>n.data.openFirst=m),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode(c,{value:!0},{default:e.withCtx(()=>[...l[12]||(l[12]=[e.createTextVNode("yes",-1)])]),_:1}),e.createVNode(c,{value:!1},{default:e.withCtx(()=>[...l[13]||(l[13]=[e.createTextVNode("No",-1)])]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",TK,[l[15]||(l[15]=e.createElementVNode("div",{class:"setting-toolbar"},[e.createElementVNode("h4",null,"组件")],-1)),e.createElementVNode("div",NK,[e.createElementVNode("div",SK,[e.createVNode(Fa,{data:n.data.data,onUpdate:l[4]||(l[4]=m=>n.data.data=m)},null,8,["data"])])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-97f379ed"]]),PK={class:"collapse-custom__wrapper"},DK=["innerHTML"],$K={class:"collapse-custom__content__wrapper"},LK={class:"component-wrapper"},Bc=ee({__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:""}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,a=t,i=e.ref(null),l=e.ref(0),s=e.ref(!1),r=e.ref(null),c=e.ref(!1),u=e.ref(!1),g=e.computed(()=>{var E;return((E=o.modelValue)==null?void 0:E.classes)??""}),m=e.computed(()=>{var E;return((E=o.modelValue)==null?void 0:E.style)??""});e.computed(()=>{var E;return(E=o.modelValue)==null?void 0:E.width});const d=e.computed(()=>{var E;return((E=o.modelValue)==null?void 0:E.title)??[]}),p=e.computed(()=>{var E;return((E=o.modelValue)==null?void 0:E.openFirst)??!1}),f=e.computed(()=>{var E,x;return!((E=o.modelValue)!=null&&E.data)||!Array.isArray(o.modelValue.data)?[]:(x=o.modelValue)==null?void 0:x.data}),h=()=>{if(o.modelValue&&o.modelValue.data)return;a("update:modelValue",{id:"CollapseCustom-O9A0oYhI",type:"CollapseCustom",desc:null,onlyShowPc:!1,title:"不一样的学习",openFirst:!1,width:"",data:[{id:"ArticleList-5AsrYlNT",type:"ArticleList",desc:null,width:"",bgColor:null,data:[{type:"Article",id:"ArticleList-1706498201-Vhj7AhhN-article-1706498204-mFwzyDVU",title:"",content:"<p><strong>大学式学习体验</strong></p>\\n\\n<ul>\\n\\t<li>汇聚四大领域特色学科:科技与革新、创业与发展、体育与健康、创意与艺术;提供核心必修课程和选修课程</li>\\n\\t<li>课程体系满足个性化学习,培养学生自主学习能力和合作学习能力</li>\\n</ul>\\n\\n<p><strong>特色职业及升学辅导</strong></p>\\n\\n<ul>\\n\\t<li>高中课程选择指导</li>\\n\\t<li>国内外知名高等院校升学指导</li>\\n\\t<li>未来大学专业报考指导</li>\\n\\t<li>全程个性化大学申请辅导</li>\\n</ul>\\n\\n<p><strong>先人一步的实践机会</strong></p>\\n\\n<ul>\\n\\t<li>邻近科技园区及研发中心,学生能近距离接触先端科技趋势</li>\\n\\t<li>与周边企业和组织建立深度合作关系,为学生提供沉浸式实习机会</li>\\n</ul>\\n",buttonList:[],linkList:[]},{type:"Image",id:"ArticleList-1706498201-Vhj7AhhN-image-1706498205-x1HZ82BS",imgSrc:"https://osswebsite-test.cedim.cn/media-library/ywies-tx/images/upper-secondary/different_1.jpg",caption:"",alt:null,isRound:!1},{type:"Image",id:"ArticleList-1706498201-Vhj7AhhN-image-1709262654-5pk9M140",imgSrc:"https://osswebsite-test.cedim.cn/media-library/ywies-tx/images/upper-secondary/1_optim.jpg",caption:"",alt:null,isRound:!1}]}]})},V=e.computed(()=>{var E;return o.isPreview?!((E=o.modelValue)!=null&&E.onlyShowPc)||!Ne():!0}),w=()=>{const E=i.value;E&&(l.value=E.scrollHeight)},k=(E,x)=>{debugger;a("handleDelete",E||o.modelValue.id,x)},y=E=>{debugger;a("handleCopy",E||o.modelValue)},b=(E,x,N)=>{debugger;a("handlePaste",E,x,N)},C=E=>{a("handleClick",E)};return e.onMounted(()=>{s.value=p.value,e.nextTick(w);const E=bK(()=>{w()},250);r.value=new ResizeObserver(E),r.value.observe(i.value)}),e.onBeforeUnmount(()=>{i.value&&r.value&&r.value.unobserve(i.value)}),h(),(E,x)=>{var N,$;return V.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["collapse-custom",g.value]),style:e.normalizeStyle(m.value),onMouseover:x[6]||(x[6]=S=>c.value=!0),onMouseout:x[7]||(x[7]=S=>c.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["collapse-custom_container",[(N=n.modelValue)!=null&&N.width?`container-content-${($=n.modelValue)==null?void 0:$.width}`:"container-content"]])},[e.createElementVNode("div",PK,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["collapse-custom__btn",{"--is-collapsed":!s.value}]),onClick:x[0]||(x[0]=S=>s.value=!s.value)},[e.createElementVNode("h4",{class:"collapse-custom__btn__title",innerHTML:d.value},null,8,DK),x[8]||(x[8]=e.createElementVNode("span",{class:"collapse-custom__btn__icon"},null,-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["collapse-custom__content",{"--is-open":s.value}]),ref_key:"content",ref:i,style:e.normalizeStyle({"--scroll-height":`${l.value}px`})},[e.createElementVNode("div",$K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(S,I)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"page-item"},[e.createElementVNode("div",LK,[e.createVNode(Co,{type:S.type,"props-data":{modelValue:S,isPreview:n.isPreview,host:n.host,locale:n.locale},onHandleDelete:x[1]||(x[1]=D=>k(D,f.value)),onHandleCopy:x[2]||(x[2]=D=>y(D)),onHandlePaste:D=>b(D,f.value,I),onHandleClick:C},null,8,["type","props-data","onHandlePaste"])])]))),128))])],6)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:c.value,"onUpdate:show":x[3]||(x[3]=S=>c.value=S),onHandleEdit:x[4]||(x[4]=S=>u.value=!0),onHandleDelete:k,onHandleCopy:y,onHandlePaste:b,style:{top:"-20px"}},null,8,["show"]))],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(BK,{key:0,show:u.value,"onUpdate:show":x[5]||(x[5]=S=>u.value=S),data:n.modelValue},null,8,["show","data"]))],38)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-51f67726"]]),AK=Object.freeze(Object.defineProperty({__proto__:null,default:Bc},Symbol.toStringTag,{value:"Module"})),IK=["onClick"],vK=ee({__name:"VrTourTab",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i=n,l=t,s=e.ref(0),r=e.ref(0),c=e.ref(0),u=e.ref(0),g=e.ref(null),m=e.ref(null),d=e.ref([]),p=e.computed(()=>s.value>40),f=e.computed(()=>c.value+u.value<r.value+40),h=e.computed({get(){return i.currentIdx??0},set(y){l("updateIdx",y)}});e.watch(a,()=>{V()});const V=()=>{var b;if(!((b=i.list)!=null&&b.length))return;m.value&&(s.value=m.value.scrollLeft),g.value&&(c.value=g.value.getBoundingClientRect().left,u.value=g.value.getBoundingClientRect().width);let y=null;d.value.length>0&&(y=Array.isArray(d.value)?d.value[d.value.length-1]:d.value),y&&y.getBoundingClientRect&&(r.value=y.getBoundingClientRect().left)},w=y=>{m.value&&(y==="next"?m.value.scrollLeft+=200:m.value.scrollLeft-=200)},k=()=>{V()};return e.onMounted(()=>{e.nextTick(()=>{k()})}),(y,b)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-tag",ref_key:"VrtourWrapper",ref:g},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"VrtourList",ref:m,onScroll:k},[e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__prev",onClick:b[0]||(b[0]=C=>w("prev"))},null,512),[[e.vShow,p.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(C,E)=>(e.openBlock(),e.createElementBlock("li",{key:E},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":h.value==E}]),ref_for:!0,ref_key:"VrtourBtn",ref:d,onClick:x=>h.value=E},e.toDisplayString(C.name),11,IK)]))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__next",onClick:b[1]||(b[1]=C=>w("next"))},null,512),[[e.vShow,f.value]])],544)],512))}},[["__scopeId","data-v-45823646"]]),MK=["onClick"],ly=ee({__name:"VrTourCat",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),a=n,i=t,l=e.ref(null),s=e.ref(null),r=e.ref(null),c=e.ref(0),u=e.ref(0),g=e.ref(0),m=e.ref(0),d=e.ref(0),p=e.computed(()=>c.value>40),f=e.computed(()=>g.value+m.value<u.value+40),h=e.computed({get(){return a.currentIdx??0},set(b){i("updateIdx",b),e.nextTick(y)}}),V=()=>{var C;if(!((C=a.list)!=null&&C.length))return;s.value&&(c.value=s.value.scrollLeft),l.value&&(g.value=l.value.getBoundingClientRect().left,m.value=l.value.getBoundingClientRect().width);let b=null;r.value&&(b=Array.isArray(r.value)?r.value[r.value.length-1]:r.value),b&&b.getBoundingClientRect&&(u.value=b.getBoundingClientRect().left)},w=b=>{b=="next"?s.value.scrollLeft+=200:s.value.scrollLeft-=200},k=()=>{s.value&&(c.value=s.value.scrollLeft),V()},y=async()=>{if(await e.nextTick(),!r.value||!r.value[h.value])return;const b=r.value[h.value],C=b.clientWidth/2,E=o.$_vsWidth/2;d.value=b.getBoundingClientRect().right-C,s.value.scrollLeft-=E-d.value};return e.watch(()=>o.$_vsWidth,()=>{V()}),e.watch(()=>a.list,()=>{e.nextTick(V),s.value&&s.value.scrollLeft&&(s.value.scrollLeft=0)},{deep:!0}),e.onMounted(()=>{e.nextTick(k)}),(b,C)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-tag",ref_key:"wrapper",ref:l},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"list",ref:s,onScroll:k},[e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__prev",onClick:C[0]||(C[0]=E=>w("prev"))},null,512),[[e.vShow,p.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(E,x)=>(e.openBlock(),e.createElementBlock("li",{key:x,class:"tab-tag__item"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":h.value==x}]),ref_for:!0,ref_key:"btnRef",ref:r,onClick:N=>h.value=x},e.toDisplayString(E.name),11,MK)]))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__next",onClick:C[1]||(C[1]=E=>w("next"))},null,512),[[e.vShow,f.value]])],544)],512))}},[["__scopeId","data-v-dec01fdd"]]),OK={class:"tab-tag__nav__prev"},UK=["onClick"],RK=["src","alt"],FK={class:"tab-tag__btn__title"},HK={class:"tab-tag__nav__next"},jK=ee({__name:"VrTourChoose",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i=n,l=t,s=e.ref(null),r=e.ref(null),c=e.ref(null),u=e.ref(0),g=e.ref(0),m=e.ref(0),d=e.ref(0),p=e.ref(0),f=e.computed(()=>u.value>0),h=e.computed(()=>g.value-40>d.value),V=e.computed({get(){return i.currentIdx??0},set(C){l("updateIdx",C),e.nextTick(y)}}),w=()=>{var E,x,N,$;if(!((E=i.list)!=null&&E.length))return;u.value=(x=r.value)==null?void 0:x.scrollLeft,m.value=(N=s.value)==null?void 0:N.getBoundingClientRect().left,d.value=($=s.value)==null?void 0:$.getBoundingClientRect().right;let C=null;c.value&&(C=Array.isArray(c.value)?c.value[c.value.length-1]:c.value),g.value=C==null?void 0:C.getBoundingClientRect().right},k=C=>{C==="next"?r.value.scrollLeft+=200:r.value.scrollLeft-=200},y=()=>{const C=c.value[V.value];if(!C)return;const E=C.clientWidth/2,x=a.value/2;p.value=C.getBoundingClientRect().right-E,r.value.scrollLeft-=x-p.value},b=()=>{w()};return e.watch(()=>a.value,()=>{w()}),e.watch(()=>i.list,()=>{e.nextTick(w),r.value&&r.value.scrollLeft&&(r.value.scrollLeft=0)}),e.onMounted(()=>{e.nextTick(b)}),(C,E)=>(e.openBlock(),e.createElementBlock("div",{class:"vr-tour-choose tab-tag",ref_key:"wrapper",ref:s},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"list",ref:r,onScroll:b},[e.withDirectives(e.createElementVNode("div",OK,[e.createElementVNode("button",{type:"button",class:"nav__btn",onClick:E[0]||(E[0]=x=>k("prev"))})],512),[[e.vShow,f.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(x,N)=>(e.openBlock(),e.createElementBlock("li",{key:N,class:"tab-tag__item"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":V.value===N}]),ref_for:!0,ref_key:"btn",ref:c,onClick:$=>V.value=N},[e.createElementVNode("img",{src:x.url,alt:x.name},null,8,RK),e.createElementVNode("div",FK,e.toDisplayString(x.name),1)],10,UK)]))),128)),e.withDirectives(e.createElementVNode("div",HK,[e.createElementVNode("button",{type:"button",class:"nav__btn",onClick:E[1]||(E[1]=x=>k("next"))})],512),[[e.vShow,h.value]])],544)],512))}},[["__scopeId","data-v-8086a4bf"]]),zK={class:"vr-tour-scene"},qK=["src"],WK={key:1,class:"vr-tour-scene__img"},GK=["src","alt"],XK=ee({__name:"VrTourScene",props:{scene:{type:Object,default:()=>({})}},setup(n){const t=n,o=e.computed(()=>{var l;return(l=t.scene)==null?void 0:l.embed}),a=e.computed(()=>{var l;return(l=t.scene)==null?void 0:l.url}),i=e.computed(()=>{var l;return(l=t.scene)==null?void 0:l.name});return(l,s)=>(e.openBlock(),e.createElementBlock("div",zK,[o.value?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:o.value,frameborder:"0"},null,8,qK)):(e.openBlock(),e.createElementBlock("div",WK,[e.createElementVNode("img",{src:a.value,alt:i.value},null,8,GK)]))]))}},[["__scopeId","data-v-c07507d5"]]),YK={class:"vr-tour-select"},KK={class:"select-btn__focus-name line-clamp-1"},QK={class:"select-list"},ZK=["onClick"],sy=ee({__name:"VrTourSelect",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i={mounted(h,V){h.clickOutsideEvent=w=>{h===w.target||h.contains(w.target)||V.value(w)},document.body.addEventListener("click",h.clickOutsideEvent)},unmounted(h){document.body.removeEventListener("click",h.clickOutsideEvent)}},l=n,s=t,r=e.ref(!1),c=e.ref(-8),u=e.ref(null),g=e.computed({get(){return l.currentIdx??0},set(h){s("updateIdx",h)}}),m=e.computed(()=>{var h;return((h=l.list[g.value])==null?void 0:h.name)||""});e.watch(r,()=>{p()}),e.onMounted(()=>{window.addEventListener("resize",()=>{a.value=window.innerWidth,r.value&&p()})});const d=()=>{r.value=!1},p=()=>{const h=u.value;if(!h)return;const V=ri(h).x+h.clientWidth;V>a.value&&(c.value=c.value-V+a.value-4)},f=h=>{g.value=h,d()};return(h,V)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",YK,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["select-btn",{"is-open":r.value}]),onClick:V[0]||(V[0]=w=>r.value=!r.value)},[e.createElementVNode("div",KK,e.toDisplayString(m.value),1),V[1]||(V[1]=e.createElementVNode("div",{class:"select-btn__arrow"},null,-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["select-block",{"is-open":r.value}]),style:e.normalizeStyle({"--left":`${c.value}px`}),ref_key:"blockRef",ref:u},[e.createElementVNode("ul",QK,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(w,k)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["select-item line-clamp-1",{"is-active":g.value===k}]),key:k,onClick:y=>f(k)},e.toDisplayString(w.name),11,ZK))),128))])],6)])),[[i,d]])}},[["__scopeId","data-v-536804a2"]]),JK={class:"setting-content"},eQ={class:"setting-header flex items-center"},tQ={class:"setting-body"},nQ={class:"setting-toolbar"},oQ={class:"tools"},aQ={class:"setting-item"},iQ={class:"item-header"},lQ={class:"btn-group"},sQ={key:0,class:"drag-handle"},rQ={key:0},dQ={class:"item-header"},cQ={class:"btn-group"},uQ={key:0,class:"drag-handle"},mQ={class:"item-header"},pQ={class:"btn-group"},hQ={key:0,class:"drag-handle"},fQ=["src"],gQ={class:"item-uplaod flex items-center"},yQ={style:{"text-align":"center"}},_Q={style:{"text-align":"center","margin-top":"20px"}},wQ=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),l=e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=e.computed(()=>({animation:200,group:"gallerys-Categories",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),r=p=>p&&p.length>1,c=n,u=t,g=()=>{u("update:show",!1)},m=(p,f)=>{debugger;const h=c.data;p==="Campus"?h.data.push({key:F(),name:"New Campus",categoriesList:[]}):p==="Category"?f.categoriesList.push(JSON.parse(JSON.stringify({key:F(),name:"New Category",facilitiesList:[]}))):p==="facilitiy"?f.facilitiesList.push({key:F(),name:"New facilitiy",url:"",scene:null,embed:""}):h.data.push({id:F(),key:F(),name:"New Tab",link:"/",componentsDataJson:[]})},d=(p,f,h)=>{debugger;if(f==="Campuses")c.data.data=c.data.data.filter(V=>V.key!==p);else if(f==="facilitiy"){const V=h.findIndex(w=>w.key===p);V!==-1&&h.splice(V,1)}else if(f==="categories"){const V=h.findIndex(w=>w.key===p);V!==-1&&h.splice(V,1)}};return(p,f)=>{const h=e.resolveComponent("a-switch"),V=e.resolveComponent("icon-plus"),w=e.resolveComponent("a-button"),k=e.resolveComponent("icon-drag-arrow"),y=e.resolveComponent("icon-delete"),b=e.resolveComponent("a-input"),C=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(C,{width:"60%",visible:n.show,footer:!1,onCancel:g,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",JK,[e.createElementVNode("div",eQ,[f[9]||(f[9]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(h,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":f[0]||(f[0]=E=>n.data.onlyShowPc=E)},null,8,["modelValue"])]),e.createElementVNode("div",tQ,[e.createElementVNode("div",nQ,[f[11]||(f[11]=e.createElementVNode("h1",null,"Campuses",-1)),e.createElementVNode("div",oQ,[e.createVNode(w,{type:"primary",onClick:f[1]||(f[1]=E=>m("Campus"))},{icon:e.withCtx(()=>[e.createVNode(V)]),default:e.withCtx(()=>[f[10]||(f[10]=e.createTextVNode(" 添加 Campus ",-1))]),_:1})])]),e.createElementVNode("div",aQ,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":f[6]||(f[6]=E=>n.data.data=E),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!r(n.data.data),onStart:f[7]||(f[7]=E=>a.value=!0),onEnd:f[8]||(f[8]=E=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:E})=>{var x;return[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(n.data.data)}]),key:E.key},[e.createElementVNode("div",iQ,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString(E.name),1)]),e.createElementVNode("div",lQ,[r(n.data.data)?(e.openBlock(),e.createElementBlock("div",sQ,[e.createVNode(k,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(y,{class:"btn-delete",onClick:N=>d(E.key,"Campuses")},null,8,["onClick"])])]),f[19]||(f[19]=e.createElementVNode("p",{class:"item-title"},"Name",-1)),e.createVNode(b,{modelValue:E.name,"onUpdate:modelValue":N=>E.name=N,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),f[20]||(f[20]=e.createElementVNode("p",{class:"item-title"},"Categories",-1)),e.createElementVNode("div",null,[(x=E.categoriesList)!=null&&x.length?(e.openBlock(),e.createElementBlock("div",rQ,[e.createVNode(e.unref(o),e.mergeProps({modelValue:E.categoriesList,"onUpdate:modelValue":N=>E.categoriesList=N,"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},s.value,{disabled:!r(E.categoriesList),onStart:f[4]||(f[4]=N=>a.value=!0),onEnd:f[5]||(f[5]=N=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:N})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(E.categoriesList)}]),key:N.id,style:{border:"1px solid #d9d9d9","border-radius":"8px"}},[e.createElementVNode("div",dQ,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString(N.name),1)]),e.createElementVNode("div",cQ,[r(E.categoriesList)?(e.openBlock(),e.createElementBlock("div",uQ,[e.createVNode(k,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(y,{class:"btn-delete",onClick:$=>d(N.key,"categories",E.categoriesList)},null,8,["onClick"])])]),f[16]||(f[16]=e.createElementVNode("p",null,"Name",-1)),e.createVNode(b,{modelValue:N.name,"onUpdate:modelValue":$=>N.name=$,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),f[17]||(f[17]=e.createElementVNode("p",{class:"item-title"},"Facilities",-1)),e.createElementVNode("div",null,[e.createVNode(e.unref(o),e.mergeProps({modelValue:N.facilitiesList,"onUpdate:modelValue":$=>N.facilitiesList=$,"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},l.value,{disabled:!r(N.facilitiesList),onStart:f[2]||(f[2]=$=>a.value=!0),onEnd:f[3]||(f[3]=$=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:$})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(N.facilitiesList)}]),key:$.key,style:{border:"1px solid #d9d9d9","border-radius":"8px"}},[e.createElementVNode("div",mQ,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString($.name),1)]),e.createElementVNode("div",pQ,[r(N.facilitiesList)?(e.openBlock(),e.createElementBlock("div",hQ,[e.createVNode(k,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(y,{class:"btn-delete",onClick:S=>d($.key,"facilitiy",N.facilitiesList)},null,8,["onClick"])])]),f[12]||(f[12]=e.createElementVNode("p",{class:"item-title"},"Name",-1)),e.createVNode(b,{modelValue:$.name,"onUpdate:modelValue":S=>$.name=S,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),f[13]||(f[13]=e.createElementVNode("p",{class:"item-title"},"图片",-1)),e.createElementVNode("img",{class:"item-img",src:$.url},null,8,fQ),e.createElementVNode("div",gQ,[e.createVNode(b,{modelValue:$.url,"onUpdate:modelValue":S=>$.url=S,placeholder:"请输入图片链接","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(je,{modelValue:$.url,"onUpdate:modelValue":S=>$.url=S,name:$.key},null,8,["modelValue","onUpdate:modelValue","name"])]),f[14]||(f[14]=e.createElementVNode("p",{class:"item-title"},"VR Embed URL",-1)),e.createVNode(b,{modelValue:$.embed,"onUpdate:modelValue":S=>$.embed=S,placeholder:"请输入","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"])],2))]),_:2},1040,["modelValue","onUpdate:modelValue","component-data","disabled"])]),e.createElementVNode("div",yQ,[e.createVNode(w,{type:"primary",onClick:$=>m("facilitiy",N)},{default:e.withCtx(()=>[...f[15]||(f[15]=[e.createTextVNode("添加Facilities",-1)])]),_:1},8,["onClick"])])],2))]),_:2},1040,["modelValue","onUpdate:modelValue","component-data","disabled"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",_Q,[e.createVNode(w,{type:"primary",onClick:N=>m("Category",E)},{default:e.withCtx(()=>[...f[18]||(f[18]=[e.createTextVNode("添加Category ",-1)])]),_:1},8,["onClick"])])],2))]}),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-73361da3"]]),bQ={class:"vr-tour__wrapper"},CQ={key:0,class:"vr-tour__tabs"},VQ={class:"container-content-middle"},xQ={key:1,class:"vr-tour__selects"},kQ={class:"container-content"},EQ={class:"vr-tour__selects__list"},TQ={class:"vr-tour__scene"},NQ={key:2,class:"vr-tour__cats"},SQ={class:"pt-2"},BQ={key:3,class:"vr-tour__chooses"},Pc=ee({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:l,$vsScreenDestroyListener:s}=o,r=t,c=n,u=e.ref(0),g=e.ref(0),m=e.ref(0),d=e.ref(!1),p=e.ref(!1),f=e.computed(()=>{var b;const y=(b=c.modelValue)==null?void 0:b.data;return Array.isArray(y)?y:[]}),h=e.computed(()=>{var b;const y=(b=f.value[u.value])==null?void 0:b.categoriesList;return Array.isArray(y)?y:[]}),V=e.computed(()=>{var b;const y=(b=h.value[g.value])==null?void 0:b.facilitiesList;return Array.isArray(y)?y:[]}),w=e.computed(()=>{var y;return(y=V.value)==null?void 0:y[m.value]}),k=()=>{var b;if(c.modelValue&&c.modelValue.data)return;const y={id:((b=c.modelValue)==null?void 0:b.id)||F(),type:"VrTour",onlyShowPc:!1,containerWidth:"",bgColor:"",classes:"custom-class another-class",style:{},width:"",data:[{key:F(),name:"SecondarySchool",categoriesList:[{key:F(),name:"Facilities",facilitiesList:[{key:F(),name:"ECE Learning Communities",url:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt/multi_floor_plans/853_floorplan.png",scene:null,embed:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt-2026/en/index.html"}]}]}]};r("update:modelValue",y),u.value=0};return e.watch(u,()=>{g.value=0}),e.watch(g,()=>{m.value=0}),k(),(y,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vr-tour bg-neutral-lightest",{"pb-0":V.value&&V.value.length<=1}]),onMouseover:b[9]||(b[9]=C=>p.value=!0),onMouseout:b[10]||(b[10]=C=>p.value=!1)},[e.createElementVNode("div",bQ,[f.value&&f.value.length>1&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",CQ,[e.createElementVNode("div",VQ,[e.createVNode(vK,{list:f.value,onUpdateIdx:b[0]||(b[0]=C=>u.value=C),currentIdx:u.value},null,8,["list","currentIdx"])])])):e.createCommentVNode("",!0),e.unref(a)<768?(e.openBlock(),e.createElementBlock("div",xQ,[e.createElementVNode("div",kQ,[e.createElementVNode("div",EQ,[f.value.length>1?(e.openBlock(),e.createBlock(sy,{key:0,list:f.value,onUpdateIdx:b[1]||(b[1]=C=>u.value=C),currentIdx:u.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0),h.value.length>1?(e.openBlock(),e.createBlock(sy,{key:1,list:h.value,onUpdateIdx:b[2]||(b[2]=C=>g.value=C),currentIdx:g.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0)])]),V.value.length>1?(e.openBlock(),e.createBlock(ly,{key:0,list:V.value,onUpdateIdx:b[3]||(b[3]=C=>m.value=C),currentIdx:m.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",TQ,[e.createVNode(XK,{scene:w.value},null,8,["scene"])]),h.value&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",NQ,[e.withDirectives(e.createElementVNode("div",SQ,null,512),[[e.vShow,h.value.length<=1&&V.value&&V.value.length>1]]),e.withDirectives(e.createVNode(ly,{list:h.value,onUpdateIdx:b[4]||(b[4]=C=>g.value=C),currentIdx:g.value},null,8,["list","currentIdx"]),[[e.vShow,h.value.length>1]])])):e.createCommentVNode("",!0),V.value&&V.value.length>1&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",BQ,[e.createVNode(jK,{list:V.value,onUpdateIdx:b[5]||(b[5]=C=>m.value=C),currentIdx:m.value},null,8,["list","currentIdx"])])):e.createCommentVNode("",!0)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:p.value,"onUpdate:show":b[6]||(b[6]=C=>p.value=C),onHandleEdit:b[7]||(b[7]=C=>d.value=!0),onHandleDelete:y.handleDelete,onHandleCopy:y.handleCopy,onHandlePaste:y.handlePaste},null,8,["show","onHandleDelete","onHandleCopy","onHandlePaste"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(wQ,{key:1,show:d.value,"onUpdate:show":b[8]||(b[8]=C=>d.value=C),data:n.modelValue},null,8,["show","data"]))],34))}},[["__scopeId","data-v-48f56fcd"]]),PQ=Object.freeze(Object.defineProperty({__proto__:null,default:Pc},Symbol.toStringTag,{value:"Module"})),DQ={class:"seting-box"},$Q={class:"setting-header flex items-center"},LQ={key:0},AQ={class:"setting-header items-center"},IQ={class:"draggable_box"},vQ={class:"drag_top_box"},MQ=["onClick"],OQ={key:0},UQ={class:"draggable_link_box"},RQ={class:"drag_link_top_box"},FQ=["onClick"],HQ=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.computed(()=>({animation:200,group:"gridLinks",disabled:!1,ghostClass:"ghost",handle:".drag-handle, .icon_drag",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),i=e.computed(()=>({animation:200,group:"gridLinkItems",disabled:!1,ghostClass:"ghost",handle:".drag-handle, .icon_drag",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),l=e.ref(!1),s=e.ref(!1),r=n,c=e.ref(new Set),u=e.ref(new Set),g=()=>{var E,x;(x=(E=r.data)==null?void 0:E.data)!=null&&x.list&&Array.isArray(r.data.data.list)&&(c.value.clear(),u.value.clear(),r.data.data.list.forEach(N=>{N.id&&c.value.add(N.id),N.links&&Array.isArray(N.links)&&N.links.length>0&&N.links.forEach($=>{$.id&&u.value.add($.id)})}))},m=e.ref(!1);e.watch(()=>r.show,E=>{E&&!m.value?(m.value=!0,e.nextTick(()=>{g()})):E||(m.value=!1)},{immediate:!0});const d=E=>{var x,N;c.value.has(E.id)?(c.value.clear(),(N=(x=r.data)==null?void 0:x.data)!=null&&N.list&&r.data.data.list.forEach($=>{$.id!==E.id&&c.value.add($.id)})):c.value.add(E.id)},p=E=>c.value.has(E.id),f=E=>{r.data.data.list=r.data.data.list.filter(x=>x.id!==E)},h=()=>{var N,$;const E=r.data.data,x=F();E.list.push({id:x,title:"这里是标题",links:[]}),c.value.clear(),($=(N=r.data)==null?void 0:N.data)!=null&&$.list&&r.data.data.list.forEach(S=>{S.id!==x&&c.value.add(S.id)}),e.nextTick(()=>{if(typeof document<"u"){const S=document.querySelector(".arco-drawer-body");S&&(S.scrollTop=S.scrollHeight)}})},V=E=>{u.value.has(E.id)?u.value.delete(E.id):u.value.add(E.id)},w=E=>u.value.has(E.id),k=E=>{const x=r.data.data.list.find(N=>N.id===E);if(x){const N=F();x.links.push({id:N,name:"这里是名称",link:""}),x.links&&Array.isArray(x.links)&&x.links.forEach($=>{$.id!==N?u.value.add($.id):u.value.delete($.id)})}},y=(E,x)=>{const N=r.data.data.list.find($=>$.id===E);N&&N.links&&(N.links=N.links.filter($=>$.id!==x))},b=t,C=()=>{b("update:show",!1)};return(E,x)=>{const N=e.resolveComponent("a-switch"),$=e.resolveComponent("a-option"),S=e.resolveComponent("a-select"),I=e.resolveComponent("icon-drag-dot"),D=e.resolveComponent("icon-drag-arrow"),A=e.resolveComponent("icon-delete"),O=e.resolveComponent("a-input"),Q=e.resolveComponent("icon-plus"),X=e.resolveComponent("a-button"),G=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(G,{width:500,visible:n.show,footer:!1,onCancel:C,unmountOnClose:""},{title:e.withCtx(()=>{var M;return[e.createTextVNode(e.toDisplayString((M=n.data)==null?void 0:M.type)+"组件编辑 ",1)]}),default:e.withCtx(()=>[e.createElementVNode("div",DQ,[e.createElementVNode("div",$Q,[x[7]||(x[7]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(N,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":x[0]||(x[0]=M=>n.data.onlyShowPc=M)},null,8,["modelValue"])]),x[19]||(x[19]=e.createElementVNode("p",{class:"item-title"},"组件宽度",-1)),e.createVNode(S,{modelValue:n.data.data.width,"onUpdate:modelValue":x[1]||(x[1]=M=>n.data.data.width=M),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode($,{value:""},{default:e.withCtx(()=>[...x[8]||(x[8]=[e.createTextVNode("默认",-1)])]),_:1}),e.createVNode($,{value:"small"},{default:e.withCtx(()=>[...x[9]||(x[9]=[e.createTextVNode("小",-1)])]),_:1}),e.createVNode($,{value:"middle"},{default:e.withCtx(()=>[...x[10]||(x[10]=[e.createTextVNode("中",-1)])]),_:1}),e.createVNode($,{value:"max"},{default:e.withCtx(()=>[...x[11]||(x[11]=[e.createTextVNode("大",-1)])]),_:1})]),_:1},8,["modelValue"]),x[20]||(x[20]=e.createElementVNode("div",{class:"part_title",style:{"margin-top":"20px"}},"链接列表",-1)),n.data.data.list.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",LQ,"暂无数据")),e.createElementVNode("div",AQ,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data.list,"onUpdate:modelValue":x[4]||(x[4]=M=>n.data.data.list=M),"component-data":{tag:"div",type:"transition-group",name:l.value?null:"flip-list"}},a.value,{disabled:!1,onStart:x[5]||(x[5]=M=>l.value=!0),onEnd:x[6]||(x[6]=M=>l.value=!1),"item-key":"id"}),{item:e.withCtx(({element:M})=>[e.createElementVNode("div",IQ,[e.createElementVNode("div",vQ,[e.createElementVNode("div",{class:"drag-handle",onClick:q=>d(M)},[e.createVNode(I,{style:{"margin-right":"10px"}}),e.createTextVNode(e.toDisplayString(M.title),1)],8,MQ),e.createElementVNode("div",null,[e.createVNode(D,{class:"icon_drag"}),e.createVNode(A,{class:"btn-delete",onClick:e.withModifiers(q=>f(M.id),["stop"])},null,8,["onClick"])])]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[x[16]||(x[16]=e.createElementVNode("p",{class:"item-title",style:{"margin-top":"20px"}},"标题",-1)),e.createVNode(O,{modelValue:M.title,"onUpdate:modelValue":q=>M.title=q,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),x[17]||(x[17]=e.createElementVNode("p",{class:"item-title",style:{"margin-top":"20px"}},"链接",-1)),M.links.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",OQ,"暂无数据")),e.createVNode(e.unref(o),e.mergeProps({modelValue:M.links,"onUpdate:modelValue":q=>M.links=q,"component-data":{tag:"div",type:"transition-group",name:s.value?null:"flip-list"}},i.value,{disabled:!1,onStart:x[2]||(x[2]=q=>s.value=!0),onEnd:x[3]||(x[3]=q=>s.value=!1),"item-key":"id"}),{item:e.withCtx(({element:q})=>[e.createElementVNode("div",UQ,[e.createElementVNode("div",RQ,[e.createElementVNode("div",{class:"drag-handle",onClick:U=>V(q)},[e.createVNode(I,{style:{"margin-right":"10px"}}),x[12]||(x[12]=e.createTextVNode("链接 ",-1))],8,FQ),e.createElementVNode("div",null,[e.createVNode(D,{class:"icon_drag"}),e.createVNode(A,{class:"btn-delete",onClick:e.withModifiers(U=>y(M.id,q.id),["stop"])},null,8,["onClick"])])]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[x[13]||(x[13]=e.createElementVNode("p",{class:"link-title",style:{"margin-top":"20px"}}," 名称 ",-1)),e.createVNode(O,{modelValue:q.name,"onUpdate:modelValue":U=>q.name=U,placeholder:"请输入名称","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),x[14]||(x[14]=e.createElementVNode("p",{class:"link-title",style:{"margin-top":"20px"}}," 链接地址 ",-1)),e.createVNode(O,{modelValue:q.link,"onUpdate:modelValue":U=>q.link=U,placeholder:"请输入链接地址","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"])],512),[[e.vShow,!w(q)]])]),_:2},1024)])]),_:2},1040,["modelValue","onUpdate:modelValue","component-data"]),e.createVNode(X,{style:{"margin-top":"20px"},size:"mini",type:"primary",onClick:q=>k(M.id)},{icon:e.withCtx(()=>[e.createVNode(Q)]),default:e.withCtx(()=>[x[15]||(x[15]=e.createTextVNode(" 链接 ",-1))]),_:1},8,["onClick"])],512),[[e.vShow,!p(M)]])]),_:2},1024)])]),_:1},16,["modelValue","component-data"])]),e.createVNode(X,{type:"primary",onClick:h,style:{"margin-top":"20px"}},{icon:e.withCtx(()=>[e.createVNode(Q)]),default:e.withCtx(()=>[x[18]||(x[18]=e.createTextVNode(" 新增 ",-1))]),_:1})])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-ffec87b5"]]),jQ=["innerHTML"],zQ={key:0,class:"grid-links__sublist"},qQ=["onClick"],WQ={key:1,class:"grid-links__subitem__link"},Sp=ee(e.defineComponent({name:"GridLinks",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,a=t,i=p=>{a("handleClick",p)},l=e.computed(()=>{var p;return o.isPreview?!((p=o.modelValue)!=null&&p.onlyShowPc)||!Ne():!0}),s=()=>{var f;if(o.modelValue&&o.modelValue.data)return;const p={id:((f=o.modelValue)==null?void 0:f.id)||F(),type:"GridLinks",onlyShowPc:!1,data:{width:"",bgColor:"white",list:[{id:F(),title:"这里是标题",links:[{id:F(),name:"这里是名称",link:""},{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"}]},{id:F(),title:"这里是标题",links:[{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"}]},{id:F(),title:"这里是标题",links:[{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"}]},{id:F(),title:"这里是标题",links:[{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"}]}]}};a("update:modelValue",p)},r=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var h,V;const p=(V=(h=o.modelValue)==null?void 0:h.data)==null?void 0:V.width;return!p||p==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[p]||"container-content"}),g=()=>{a("handleDelete",o.modelValue.id)},m=()=>{a("handleCopy",o.modelValue)},d=p=>{a("handlePaste",p)};return s(),(p,f)=>{var h,V;return e.openBlock(),e.createElementBlock(e.Fragment,null,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"gridLinks_wrap",onMouseenter:f[2]||(f[2]=w=>r.value=!0),onMouseleave:f[3]||(f[3]=w=>r.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(u.value)},[e.createElementVNode("div",{class:"grid-links__row",style:e.normalizeStyle({"--grid-columns-mobile":p.mobileCol,"--grid-columns-desktop":p.desktopCol})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((V=(h=n.modelValue)==null?void 0:h.data)==null?void 0:V.list)||[],(w,k)=>(e.openBlock(),e.createElementBlock("div",{class:"grid-links__item",key:`${(w==null?void 0:w.title)||"item"}-${k}`},[e.createElementVNode("h6",{class:"grid-links__item__title",innerHTML:(w==null?void 0:w.title)||""},null,8,jQ),Array.isArray(w==null?void 0:w.links)&&w.links.length?(e.openBlock(),e.createElementBlock("ul",zQ,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((w==null?void 0:w.links)||[],(y,b)=>(e.openBlock(),e.createElementBlock("li",{key:`${(y==null?void 0:y.name)||"sub"}-${b}`,class:"grid-links__subitem"},[y!=null&&y.link?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:C=>i(y.link),class:"link_text"},[e.createTextVNode(e.toDisplayString(y==null?void 0:y.name)+" ",1),f[5]||(f[5]=e.createElementVNode("span",{class:"link_text__underline"},null,-1))],8,qQ)):(e.openBlock(),e.createElementBlock("div",WQ,e.toDisplayString(y==null?void 0:y.name),1))]))),128))])):e.createCommentVNode("",!0)]))),128))],4)],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:r.value,"onUpdate:show":f[0]||(f[0]=w=>r.value=w),onHandleEdit:f[1]||(f[1]=w=>c.value=!0),onHandleDelete:g,onHandleCopy:m,onHandlePaste:d},null,8,["show"]))],32)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(HQ,{key:1,show:c.value,"onUpdate:show":f[4]||(f[4]=w=>c.value=w),data:n.modelValue},null,8,["show","data"]))],64)}}}),[["__scopeId","data-v-9efa8188"]]),GQ=Object.freeze(Object.defineProperty({__proto__:null,default:Sp},Symbol.toStringTag,{value:"Module"})),XQ={class:"setting-content"},YQ={class:"setting-header flex items-center"},KQ={class:"setting-header flex items-center"},QQ={class:"setting-body"},ZQ={class:"setting-toolbar"},JQ={class:"tools"},eZ={class:"setting-item"},tZ={class:"item-header"},nZ={class:"btn-group"},oZ={key:0,class:"drag-handle"},aZ=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.defineAsyncComponent(()=>Promise.resolve().then(()=>_t)),i=e.ref(!1),l=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=d=>d&&d.length>1,r=n,c=t,u=()=>{c("update:show",!1)},g=d=>{r.data.data.push({key:F(),title:"[[TITLE]]",content:""})},m=d=>{r.data.data=r.data.data.filter(p=>p.key!==d)};return(d,p)=>{const f=e.resolveComponent("a-switch"),h=e.resolveComponent("a-option"),V=e.resolveComponent("a-select"),w=e.resolveComponent("icon-plus"),k=e.resolveComponent("a-button"),y=e.resolveComponent("icon-drag-arrow"),b=e.resolveComponent("icon-delete"),C=e.resolveComponent("a-input"),E=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(E,{width:"60%",visible:n.show,footer:!1,onCancel:u,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",XQ,[e.createElementVNode("div",YQ,[p[7]||(p[7]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(f,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":p[0]||(p[0]=x=>n.data.onlyShowPc=x)},null,8,["modelValue"])]),e.createElementVNode("div",KQ,[p[12]||(p[12]=e.createElementVNode("span",{class:"header-title"},"组件宽度",-1)),e.createVNode(V,{modelValue:n.data.width,"onUpdate:modelValue":p[1]||(p[1]=x=>n.data.width=x),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode(h,{value:""},{default:e.withCtx(()=>[...p[8]||(p[8]=[e.createTextVNode("默认",-1)])]),_:1}),e.createVNode(h,{value:"small"},{default:e.withCtx(()=>[...p[9]||(p[9]=[e.createTextVNode("小",-1)])]),_:1}),e.createVNode(h,{value:"middle"},{default:e.withCtx(()=>[...p[10]||(p[10]=[e.createTextVNode("中",-1)])]),_:1}),e.createVNode(h,{value:"max"},{default:e.withCtx(()=>[...p[11]||(p[11]=[e.createTextVNode("大",-1)])]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",QQ,[e.createElementVNode("div",ZQ,[p[15]||(p[15]=e.createElementVNode("h4",null,"Topics",-1)),e.createElementVNode("div",JQ,[e.createVNode(k,{type:"primary",onClick:p[2]||(p[2]=x=>g())},{icon:e.withCtx(()=>[e.createVNode(w)]),default:e.withCtx(()=>[p[13]||(p[13]=e.createTextVNode(" 添加 Tab ",-1))]),_:1}),e.createVNode(k,{type:"primary",onClick:p[3]||(p[3]=x=>g())},{default:e.withCtx(()=>[...p[14]||(p[14]=[e.createTextVNode("粘贴 Tab",-1)])]),_:1})])]),e.createElementVNode("div",eZ,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":p[4]||(p[4]=x=>n.data.data=x),"component-data":{tag:"div",type:"transition-group",name:i.value?null:"flip-list"}},l.value,{disabled:!s(n.data.data),onStart:p[5]||(p[5]=x=>i.value=!0),onEnd:p[6]||(p[6]=x=>i.value=!1),"item-key":"key"}),{item:e.withCtx(({element:x})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!s(n.data.data)}]),key:x.key},[e.createElementVNode("div",tZ,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(x.title),1)]),e.createElementVNode("div",nZ,[s(n.data.data)?(e.openBlock(),e.createElementBlock("div",oZ,[e.createVNode(y,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(b,{class:"btn-delete",onClick:N=>m(x.key)},null,8,["onClick"])])]),p[16]||(p[16]=e.createElementVNode("p",{class:"item-title"},"title",-1)),e.createVNode(C,{modelValue:x.title,"onUpdate:modelValue":N=>x.title=N,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[17]||(p[17]=e.createElementVNode("p",{class:"item-title"},"Content",-1)),e.createVNode(e.unref(a),{modelValue:x.content,"onUpdate:modelValue":N=>x.content=N,name:`AccordionText_${x.key}`},null,8,["modelValue","onUpdate:modelValue","name"])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-a711b39a"]]),iZ=["id"],lZ=["id"],sZ=["onClick"],rZ={class:"accordion-button__title"},dZ=["id","aria-expanded","aria-labelledby"],cZ={class:"accordion-body"},uZ=["innerHTML"],mZ={class:"flex-center mt-10"},Dc=ee({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:l,$vsScreenDestroyListener:s}=o,r=n,c=t,u=()=>{var O;if(r.modelValue&&Array.isArray(r.modelValue.data)&&r.modelValue.data.length){r.modelValue.openFirst&&p.value.size===0&&p.value.add(r.modelValue.data[0].key);return}const A={id:((O=r.modelValue)==null?void 0:O.id)||F(),type:"AccordionText",onlyShowPc:!1,openFirst:!1,width:"",style:{},data:[{key:F(),title:"tab1",content:"这是内容"}]};c("update:modelValue",A)},g=e.ref(Date.now()),m=e.ref(6),d=e.ref(6),p=e.ref(new Set),f=e.ref([]),h=e.ref(!1),V=e.ref(!1),w=e.computed(()=>{var A;return(A=r.modelValue)!=null&&A.hasOwnProperty("classes")?r.modelValue.classes:null}),k=e.computed(()=>{var A;return(A=r.modelValue)!=null&&A.hasOwnProperty("style")?r.modelValue.style:null});e.computed(()=>{var A;return(A=r.modelValue)!=null&&A.hasOwnProperty("width")?r.modelValue.width:null});const y=e.computed(()=>{var O;const A=(O=r.modelValue)==null?void 0:O.data;return Array.isArray(A)?A:[]}),b=e.computed(()=>y.value.slice(0,m.value)),C=A=>{var O;p.value.has(A)?p.value.delete(A):((O=r.modelValue)!=null&&O.allowMultiple||p.value.clear(),p.value.add(A)),setTimeout(()=>{x(document.getElementById(`accordion-${g.value}-${A}`))},350)},E=A=>p.value.has(A),x=A=>{if(a.value>=768)return;const Q=ri(A).y-150;window.scroll({top:Q,left:0,behavior:"smooth"})},N=()=>{a.value>=768?(m.value=6,d.value=6):(m.value=4,d.value=4)},$=(A,O)=>{debugger;c("handleDelete",A||r.modelValue.id,O)},S=A=>{debugger;c("handleCopy",A||r.modelValue)},I=(A,O)=>{debugger;c("handlePaste",A,O)},D=()=>{};return e.watch(y,(A,O)=>{var Q;N(),(Q=r.modelValue)!=null&&Q.openFirst&&A.length>0&&p.value.size===0&&p.value.add(A[0].key)},{deep:!0,immediate:!0}),e.watch(b,()=>{e.nextTick(D)},{immediate:!1}),e.onMounted(()=>{var A;e.nextTick(N),(A=r.modelValue)!=null&&A.openFirst&&y.value.length>0&&p.value.size===0&&p.value.add(y.value[0].key)}),u(),(A,O)=>{var Q,X;return e.openBlock(),e.createElementBlock("div",{onMouseover:O[4]||(O[4]=G=>V.value=!0),onMouseout:O[5]||(O[5]=G=>V.value=!1),class:e.normalizeClass(["accordion-text",w.value]),id:`accordion-parent-${g.value}`,style:e.normalizeStyle(k.value)},[e.createElementVNode("div",{class:e.normalizeClass(["accordion-text__container",[(Q=n.modelValue)!=null&&Q.width?`container-content-${(X=n.modelValue)==null?void 0:X.width}`:"container-content"]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(G,M)=>(e.openBlock(),e.createElementBlock("div",{key:G.key,class:"accordion-item",ref_for:!0,ref_key:"itemRefs",ref:f,"data-aos":"fade-in"},[e.createElementVNode("div",{class:"accordion-header",id:`accordion-${g.value}-${G.key}`},[e.createElementVNode("button",{class:e.normalizeClass(["accordion-button",{collapsed:!E(G.key)}]),type:"button",onClick:q=>C(G.key)},[e.createElementVNode("div",null,[e.createElementVNode("div",rZ,e.toDisplayString(G.title),1)]),O[6]||(O[6]=e.createElementVNode("span",{class:"accordion-button__icon"},null,-1))],10,sZ)],8,lZ),e.createElementVNode("div",{id:`accordion-${g.value}-collapse-${G.key}`,class:e.normalizeClass(["accordion-collapse collapse",{show:E(G.key)}]),"aria-expanded":E(G.key),"aria-labelledby":`accordion-${g.value}-${G.key}`,style:e.normalizeStyle({height:E(G.key)?"auto":"0",overflow:"hidden"})},[e.createElementVNode("div",cZ,[e.createElementVNode("div",{class:"accordion__content",innerHTML:G.content},null,8,uZ)])],14,dZ)]))),128)),e.withDirectives(e.createElementVNode("div",mZ,[e.createElementVNode("button",{type:"button",class:"btn btn__load-more",onClick:O[0]||(O[0]=G=>m.value+=d.value)},[...O[7]||(O[7]=[e.createElementVNode("span",{class:"i i-load-more"},null,-1)])])],512),[[e.vShow,m.value<y.value.length]]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:V.value,"onUpdate:show":O[1]||(O[1]=G=>V.value=G),onHandleEdit:O[2]||(O[2]=G=>h.value=!0),onHandleDelete:$,onHandleCopy:S,onHandlePaste:I,style:{top:"-10px"}},null,8,["show"]))],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(aZ,{key:0,show:h.value,"onUpdate:show":O[3]||(O[3]=G=>h.value=G),data:n.modelValue},null,8,["show","data"]))],46,iZ)}}},[["__scopeId","data-v-401b6b46"]]),pZ=Object.freeze(Object.defineProperty({__proto__:null,default:Dc},Symbol.toStringTag,{value:"Module"})),hZ={install:n=>{n.component("RibbonBlock",Br)}},fZ={install:n=>{n.component("TimelineStory",Pr)}},gZ={install:n=>{n.component("NewsList",Dr)}},yZ={install:n=>{n.component("TheHistoryCarousel",$r)}},_Z={install:n=>{n.component("CardShowcaseProfile",Lr)}},wZ={install:n=>{n.component("ArticleList",fl)}},bZ={install:n=>{n.component("BannerImage",Rs)}},CZ={install:n=>{n.component("BannerPage",Fs)}},VZ={install:n=>{n.component("BtnList",gl)}},xZ={install:n=>{n.component("GalleryDefault",Hs)}},kZ={install:n=>{n.component("GalleryCaptionRound",js)}},EZ={install:n=>{n.component("GalleryTimeline",hr)}},TZ={install:n=>{n.component("GalleryTimelineCol",fr)}},NZ={install:n=>{n.component("Process",gr)}},SZ={install:n=>{n.component("CustomSpace",yr)}},BZ={install:n=>{n.component("GalleryList",br)}},PZ={install:n=>{n.component("HeroSlide",Cr)}},DZ={install:n=>{n.component("LinkList",Vr)}},$Z={install:n=>{n.component("QuoteText",xr)}},LZ={install:n=>{n.component("DonorLinks",kr)}},AZ={install:n=>{n.component("CardCarousel",Er)}},IZ={install:n=>{n.component("CardCarouselMultiRow",Tr)}},vZ={install:n=>{n.component("BannerQuote",Nr)}},MZ={install:n=>{n.component("ArticleItem",Sr)}},OZ={install:n=>{n.component("CountDown",Ar)}},UZ={install:n=>{n.component("CustomIframe",Ir)}},RZ={install:n=>{n.component("BannerImageWithLink",Or)}},FZ={install:n=>{n.component("ContactUsList",vr)}},HZ={install:n=>{n.component("TableTwo",Mr)}},jZ={install:n=>{n.component("ScrollKeyInfo",Ur)}},zZ={install:n=>{n.component("ContactUsInfo",Rr)}},qZ={install:n=>{n.component("Publications",Fr)}},WZ={install:n=>{n.component("MapStatic",Hr)}},GZ={install:n=>{n.component("CardCarouselArticles",Qr)}},XZ={install:n=>{n.component("CarouselLogo",jr)}},YZ={install:n=>{n.component("Resources",zr)}},KZ={install:n=>{n.component("ResourcesTwo",qr)}},QZ={install:n=>{n.component("Disc",Wr)}},ZZ={install:n=>{n.component("BasicCollapse",Gr)}},JZ={install:n=>{n.component("TableCollapse",Xr)}},eJ={install:n=>{n.component("MediaLogo",vl)}},tJ={install:n=>{n.component("RegisterForm",Yr)}},nJ={install:n=>{n.component("GalleryBlock",Kr)}},oJ={install:n=>{n.component("CardCarouselMultiRowArticles",Zr)}},aJ={install:n=>{n.component("AlummiCommunityList",od)}},iJ={install:n=>{n.component("BlessingMessage",ad)}},lJ={install:n=>{n.component("BlessingSlider",id)}},sJ={install:n=>{n.component("CardShowcase",ld)}},rJ={install:n=>{n.component("ExploreLinks",sd)}},dJ={install:n=>{n.component("SchoolLayout",dd)}},cJ={install:n=>{n.component("CardCarouselMultiRowPublications",cd)}},uJ={install:n=>{n.component("CustomText",Jr)}},mJ={install:n=>{n.component("MediaImageFull",ed)}},pJ={install:n=>{n.component("MediaImageStatic",td)}},hJ={install:n=>{n.component("ArticleListPureText",nd)}},fJ={install:n=>{n.component("TabDefault",ud)}},gJ={install:n=>{n.component("TabTimeLine",md)}},yJ={install:n=>{n.component("CardListProgramme",hd)}},_J={install:n=>{n.component("CardListCircle",pd)}},wJ={install:n=>{n.component("CardListSchool",fd)}},bJ={install:n=>{n.component("MediaVideo",xc)}},CJ={install:n=>{n.component("DetailLink",gd)}},VJ={install:n=>{n.component("InformationLink",kc)}},xJ={install:n=>{n.component("TabPage",Ec)}},kJ={install:n=>{n.component("AccordionText",Dc)}},EJ={install:n=>{n.component("TabLogo",Tc)}},TJ={install:n=>{n.component("BackgroundWrapper",Nc)}},NJ={install:n=>{n.component("CollapseCustom",Bc)}},SJ={install:n=>{n.component("VrTour",Pc)}},Bp={default:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"14px",fontFamily:"Inter, sans-serif",borderRadius:"6px",spacing:"16px"},dark:{primaryColor:"#60a5fa",secondaryColor:"#c084fc",fontSize:"14px",fontFamily:"Inter, sans-serif",borderRadius:"6px",spacing:"16px"},compact:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"12px",fontFamily:"Inter, sans-serif",borderRadius:"4px",spacing:"12px"},large:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"16px",fontFamily:"Inter, sans-serif",borderRadius:"8px",spacing:"20px"}},Bn=e.ref(Bp.default),Ao=e.ref(!1);function BJ(){const n=f=>{typeof f=="string"?Bn.value={...Bp[f]}:Bn.value={...f},a()},t=f=>{Bn.value={...Bn.value,...f},a()},o=()=>{Ao.value=!Ao.value,typeof document<"u"&&document.documentElement.classList.toggle("dark",Ao.value)},a=()=>{if(typeof document>"u")return;const f=document.documentElement,h=Bn.value;f.style.setProperty("--theme-primary",h.primaryColor),f.style.setProperty("--theme-secondary",h.secondaryColor),f.style.setProperty("--font-size-default",h.fontSize),f.style.setProperty("--radius-md",h.borderRadius),f.style.setProperty("--spacing-md",h.spacing)},i=f=>e.computed(()=>f==="primary"?Bn.value.primaryColor:Bn.value.secondaryColor),l=()=>e.computed(()=>Bn.value.fontSize),s=()=>e.computed(()=>Bn.value.fontFamily),r=()=>e.computed(()=>Bn.value.borderRadius),c=()=>e.computed(()=>Bn.value.spacing),u=()=>{n("default"),Ao.value=!1,typeof document<"u"&&document.documentElement.classList.remove("dark")},g=()=>JSON.stringify(Bn.value,null,2),m=f=>{try{const h=JSON.parse(f);return n(h),!0}catch(h){return console.error("Invalid theme configuration:",h),!1}},d=()=>{const f=typeof window<"u"&&typeof localStorage<"u",h=f?localStorage.getItem("officialblock-theme"):null,V=f?localStorage.getItem("officialblock-dark-mode"):null;if(h)try{const w=JSON.parse(h);n(w)}catch(w){console.error("Failed to restore theme:",w)}if(V&&(Ao.value=V==="true",typeof document<"u"&&document.documentElement.classList.toggle("dark",Ao.value)),typeof window<"u"&&typeof window.matchMedia=="function"){const w=window.matchMedia("(prefers-color-scheme: dark)"),k=y=>{(!f||!localStorage.getItem("officialblock-dark-mode"))&&(Ao.value=y.matches,typeof document<"u"&&document.documentElement.classList.toggle("dark",Ao.value))};w.addEventListener("change",k)}a()},p=()=>{typeof window<"u"&&typeof localStorage<"u"&&(localStorage.setItem("officialblock-theme",JSON.stringify(Bn.value)),localStorage.setItem("officialblock-dark-mode",Ao.value.toString()))};return{currentTheme:e.computed(()=>Bn.value),isDarkMode:e.computed(()=>Ao.value),themePresets:Bp,setTheme:n,updateTheme:t,toggleDarkMode:o,resetTheme:u,exportTheme:g,importTheme:m,initTheme:d,saveTheme:p,getThemeColor:i,getFontSize:l,getFontFamily:s,getBorderRadius:r,getSpacing:c}}class PJ{static hexToRgb(t){const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return o?{r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)}:null}static rgbToHex(t,o,a){return"#"+((1<<24)+(t<<16)+(o<<8)+a).toString(16).slice(1)}static adjustBrightness(t,o){const a=this.hexToRgb(t);if(!a)return t;const i=l=>{const s=Math.round(l*(1+o/100));return Math.max(0,Math.min(255,s))};return this.rgbToHex(i(a.r),i(a.g),i(a.b))}static generateColorScale(t){const o=[50,100,200,300,400,500,600,700,800,900,950],a={};return o.forEach((i,l)=>{let s;i<=500?s=80-l*16:s=-20-(l-5)*12,a[i.toString()]=this.adjustBrightness(t,s)}),a}static getContrastRatio(t,o){const a=c=>{const u=this.hexToRgb(c);if(!u)return 0;const g=m=>{const d=m/255;return d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4)};return .2126*g(u.r)+.7152*g(u.g)+.0722*g(u.b)},i=a(t),l=a(o),s=Math.max(i,l),r=Math.min(i,l);return(s+.05)/(r+.05)}static isDarkColor(t){const o=this.hexToRgb(t);return o?(o.r*299+o.g*587+o.b*114)/1e3<128:!1}static getBestTextColor(t){return this.isDarkColor(t)?"#ffffff":"#000000"}static mixColors(t,o,a=.5){const i=this.hexToRgb(t),l=this.hexToRgb(o);if(!i||!l)return t;const s=(r,c)=>Math.round(r*(1-a)+c*a);return this.rgbToHex(s(i.r,l.r),s(i.g,l.g),s(i.b,l.b))}}class DJ{static getCurrentBreakpoint(){if(typeof window>"u")return"xl";const t=window.innerWidth;return t<475?"xs":t<640?"sm":t<768?"md":t<1024?"lg":t<1280?"xl":"2xl"}static isMobile(){return typeof window>"u"?!1:window.innerWidth<768}static isTablet(){if(typeof window>"u")return!1;const t=window.innerWidth;return t>=768&&t<1024}static isDesktop(){return typeof window>"u"?!0:window.innerWidth>=1024}static onBreakpointChange(t){if(typeof window>"u")return()=>{};let o=this.getCurrentBreakpoint();const a=()=>{const i=this.getCurrentBreakpoint();i!==o&&(o=i,t(i))};return window.addEventListener("resize",a),()=>{typeof window<"u"&&window.removeEventListener("resize",a)}}}class ry{static animate(t,o,a,i,l=this.easing.easeOutQuad){if(typeof window>"u"||typeof requestAnimationFrame>"u"||typeof performance>"u")return i(o),()=>{};const s=performance.now();let r;const c=u=>{const g=u-s,m=Math.min(g/a,1),d=l(m),p=t+(o-t)*d;i(p),m<1&&(r=requestAnimationFrame(c))};return r=requestAnimationFrame(c),()=>{r&&cancelAnimationFrame(r)}}static scrollTo(t,o,a=300,i=this.easing.easeOutQuad){return new Promise(l=>{if(typeof window>"u"){l();return}const s=t===window,r=s?window.pageYOffset:t.scrollTop;this.animate(r,o,a,c=>{s?window.scrollTo(0,c):t.scrollTop=c},i),setTimeout(l,a)})}}aa(ry,"easing",{linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:-1+(4-2*t)*t,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1});class $J{static setItem(t,o){if(typeof window>"u"||typeof localStorage>"u")return!1;try{return localStorage.setItem(t,JSON.stringify(o)),!0}catch(a){return console.warn("Failed to save to localStorage:",a),!1}}static getItem(t,o){if(typeof window>"u"||typeof localStorage>"u")return o||null;try{const a=localStorage.getItem(t);return a?JSON.parse(a):o||null}catch(a){return console.warn("Failed to read from localStorage:",a),o||null}}static removeItem(t){if(typeof window>"u"||typeof localStorage>"u")return!1;try{return localStorage.removeItem(t),!0}catch(o){return console.warn("Failed to remove from localStorage:",o),!1}}static cleanExpired(){if(typeof window>"u"||typeof localStorage>"u")return;const t=Date.now(),o=[];for(let a=0;a<localStorage.length;a++){const i=localStorage.key(a);if(i&&i.startsWith("officialblock-"))try{const l=JSON.parse(localStorage.getItem(i)||"{}");l.expires&&l.expires<t&&o.push(i)}catch{}}o.forEach(a=>localStorage.removeItem(a))}}if(typeof globalThis<"u"&&!globalThis.FormData){class n{constructor(){aa(this,"data",new Map)}append(o,a,i){this.data.set(o,{value:a,filename:i})}get(o){const a=this.data.get(o);return a?a.value:null}has(o){return this.data.has(o)}delete(o){this.data.delete(o)}entries(){return this.data.entries()}keys(){return this.data.keys()}values(){return this.data.values()}[Symbol.iterator](){return this.data.entries()}}globalThis.FormData=n}const LJ={install:n=>{n.use(Kp),n.config.globalProperties.$device={get isMobile(){return typeof window<"u"?window.innerWidth<768:!1},get isTablet(){return typeof window<"u"?window.innerWidth>=768&&window.innerWidth<1024:!1},get isMobileOrTablet(){return typeof window<"u"?window.innerWidth<1024:!1},get isDesktop(){return typeof window<"u"?window.innerWidth>=1024:!0}},n.component("ArticleList",fl),n.component("BannerImage",Rs),n.component("BannerPage",Fs),n.component("BtnList",gl),n.component("GalleryDefault",Hs),n.component("GalleryCaptionRound",js),n.component("GalleryTimeline",hr),n.component("GalleryTimelineCol",fr),n.component("Process",gr),n.component("CustomSpace",yr),n.component("GalleryList",br),n.component("HeroSlide",Cr),n.component("LinkList",Vr),n.component("QuoteText",xr),n.component("DonorLinks",kr),n.component("CardCarousel",Er),n.component("CardCarouselMultiRow",Tr),n.component("BannerQuote",Nr),n.component("ArticleItem",Sr),n.component("RibbonBlock",Br),n.component("TimelineStory",Pr),n.component("NewsList",Dr),n.component("TheHistoryCarousel",$r),n.component("CardShowcaseProfile",Lr),n.component("CountDown",Ar),n.component("ContactUsList",vr),n.component("CustomIframe",Ir),n.component("TableTwo",Mr),n.component("ScrollKeyInfo",Ur),n.component("BannerImageWithLink",Or),n.component("ContactUsInfo",Rr),n.component("Publications",Fr),n.component("MapStatic",Hr),n.component("CardCarouselArticles",Qr),n.component("CarouselLogo",jr),n.component("Resources",zr),n.component("ResourcesTwo",qr),n.component("Disc",Wr),n.component("BasicCollapse",Gr),n.component("TableCollapse",Xr),n.component("MediaLogo",vl),n.component("RegisterForm",Yr),n.component("GalleryBlock",Kr),n.component("CardCarouselMultiRowArticles",Zr),n.component("AlummiCommunityList",od),n.component("BlessingMessage",ad),n.component("BlessingSlider",id),n.component("CardShowcase",ld),n.component("ExploreLinks",sd),n.component("SchoolLayout",dd),n.component("CardCarouselMultiRowPublications",cd),n.component("CustomText",Jr),n.component("MediaImageFull",ed),n.component("MediaImageStatic",td),n.component("ArticleListPureText",nd),n.component("TabDefault",ud),n.component("CardListProgramme",hd),n.component("CardListCircle",pd),n.component("CardListSchool",fd),n.component("MediaVideo",xc),n.component("DetailLink",gd),n.component("InformationLink",kc),n.component("TabTimeLine",md),n.component("TabPage",Ec),n.component("TabLogo",Tc),n.component("BackgroundWrapper",Nc),n.component("CollapseCustom",Bc),n.component("VrTour",Pc),n.component("AccordionText",Dc),n.component("GridLinks",Sp)}},AJ={class:"rich-text-editor"},_t=Object.freeze(Object.defineProperty({__proto__:null,default:ee(e.defineComponent({__name:"index",props:{name:{default:""},modelValue:{default:""},placeholder:{default:"请输入内容..."},height:{default:"400px"},mode:{default:"default"},disabled:{type:Boolean,default:!1},maxLength:{default:1e4},excludeKeys:{default:()=>[]},includeKeys:{default:()=>[]}},emits:["update:modelValue","change","focus","blur","created","upload-image","upload-video"],setup(n,{expose:t,emit:o}){const a=n,i=o,l=e.shallowRef(),s=e.ref(""),r=e.computed(()=>typeof a.height=="number"?`${a.height}px`:a.height),c=e.inject("handleUpload",()=>{}),u=e.inject("fileUrl",null),g=e.inject("chooseName",null),m=e.ref(""),d=e.ref(null),p=S=>{if(!c){console.warn("Upload: handleUpload function not provided by ancestor");return}if(m.value=S,l.value)try{const D=l.value.selection;D&&(d.value={anchor:{path:[...D.anchor.path],offset:D.anchor.offset},focus:{path:[...D.focus.path],offset:D.focus.offset}})}catch(D){console.warn("保存光标位置失败:",D)}const I=a.name+"_"+S;c(!0,I)};e.watch(()=>a.name,()=>{u.value=null},{deep:!0,immediate:!0}),e.watch(()=>[u==null?void 0:u.value],([S])=>{const I=a.name+"_"+m.value;!S||!g.value||g.value!==I||l.value&&e.nextTick(()=>{var D,A;if(l.value){try{if(l.value.focus(),d.value)try{l.value.select(d.value)}catch(O){console.warn("恢复光标位置失败,使用默认位置:",O)}}catch(O){console.warn("聚焦编辑器失败:",O)}if(m.value==="img"){const Q=`<img src="${S}" alt="图片" style="max-width: 100%;">`;(D=l.value)==null||D.dangerouslyInsertHtml(Q)}else{const Q=`<video src="${S}" controls style="max-width: 100%;"></video>`;(A=l.value)==null||A.dangerouslyInsertHtml(Q)}d.value=null,m.value=""}})},{immediate:!1});function f(S){return class{constructor(){aa(this,"title");aa(this,"tag");aa(this,"iconSvg");this.title="上传图片",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>'}isActive(){return!1}getValue(){return""}isDisabled(){return!1}exec(){e.nextTick(()=>{console.log("点击了自定义上传图片菜单"),S("img")})}}}function h(S){return class{constructor(){aa(this,"title");aa(this,"tag");aa(this,"iconSvg");this.title="上传视频",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>'}getValue(){return""}isActive(){return!1}isDisabled(){return!1}exec(){e.nextTick(()=>{console.log("点击了自定义上传视频菜单"),S("video")})}}}const V={toolbarKeys:["headerSelect","bold","italic","through","underline","color","fontSize","lineHeight","delIndent","indent","divider","insertTable","justifyCenter","justifyJustify","justifyLeft","justifyRight","bulletedList","numberedList","undo","redo","clearStyle","codeBlock"]},w={placeholder:a.placeholder,readOnly:a.disabled,maxLength:a.maxLength,MENU_CONF:{},hoverbarKeys:{text:{menuKeys:["headerSelect","insertLink","bold","italic","underline","through","clearStyle"]}}},k=Math.random().toString(36).substring(2,9),y=`CustomImageMenu_${k}`,b=`CustomVideoMenu_${k}`,C=S=>{l.value=S;try{const I=f(p),D=h(p),A={key:y,factory(){return new I}},O={key:b,factory(){return new D}};qp.Boot.registerMenu(A),qp.Boot.registerMenu(O)}catch(I){console.warn("菜单注册失败:",I)}V.insertKeys={index:0,keys:[y,b]},i("created",S)};e.onBeforeUnmount(()=>{const S=l.value;S!=null&&S.destroy()}),e.watch(()=>a.modelValue,S=>{S!==s.value&&(s.value=S||"")},{immediate:!0});const E=S=>{i("update:modelValue",s.value),i("change",S)},x=()=>{l.value=void 0},N=S=>{i("focus",S)},$=S=>{i("blur",S)};return t({editor:l,getHtml:()=>s.value,getText:()=>{var S;return((S=l.value)==null?void 0:S.getText())||""},isEmpty:()=>{var S;return((S=l.value)==null?void 0:S.isEmpty())||!0},clear:()=>{var S;return(S=l.value)==null?void 0:S.clear()},focus:()=>{var S;return(S=l.value)==null?void 0:S.focus()},blur:()=>{var S;return(S=l.value)==null?void 0:S.blur()},disable:()=>{var S;return(S=l.value)==null?void 0:S.disable()},enable:()=>{var S;return(S=l.value)==null?void 0:S.enable()}}),(S,I)=>(e.openBlock(),e.createElementBlock("div",AJ,[e.createVNode(e.unref(zp.Toolbar),{class:"editor-toolbar",editor:l.value,defaultConfig:V,mode:n.mode},null,8,["editor","mode"]),e.createVNode(e.unref(zp.Editor),{class:"editor-content",style:e.normalizeStyle({height:r.value}),modelValue:s.value,"onUpdate:modelValue":I[0]||(I[0]=D=>s.value=D),defaultConfig:w,mode:n.mode,onOnCreated:C,onOnChange:E,onOnDestroyed:x,onOnFocus:N,onOnBlur:$},null,8,["style","modelValue","mode"])]))}}),[["__scopeId","data-v-55807020"]])},Symbol.toStringTag,{value:"Module"}));ae.AccordionText=Dc,ae.AccordionTextPlugin=kJ,ae.AlummiCommunityList=od,ae.AlummiCommunityListPlugin=aJ,ae.AnimationUtils=ry,ae.ArticleItem=Sr,ae.ArticleItemPlugin=MZ,ae.ArticleList=fl,ae.ArticleListPlugin=wZ,ae.ArticleListPureText=nd,ae.ArticleListPureTextPlugin=hJ,ae.BackgroundWrapper=Nc,ae.BackgroundWrapperPlugin=TJ,ae.BannerImage=Rs,ae.BannerImagePlugin=bZ,ae.BannerImageWithLink=Or,ae.BannerImageWithLinkPlugin=RZ,ae.BannerPage=Fs,ae.BannerPagePlugin=CZ,ae.BannerQuote=Nr,ae.BannerQuotePlugin=vZ,ae.BasicCollapse=Gr,ae.BasicCollapsePlugin=ZZ,ae.BlessingMessage=ad,ae.BlessingMessagePlugin=iJ,ae.BlessingSlider=id,ae.BlessingSliderPlugin=lJ,ae.BtnList=gl,ae.BtnListPlugin=VZ,ae.CardCarousel=Er,ae.CardCarouselArticles=Qr,ae.CardCarouselArticlesPlugin=GZ,ae.CardCarouselMultiRow=Tr,ae.CardCarouselMultiRowArticles=Zr,ae.CardCarouselMultiRowArticlesPlugin=oJ,ae.CardCarouselMultiRowPlugin=IZ,ae.CardCarouselMultiRowPublications=cd,ae.CardCarouselMultiRowPublicationsPlugin=cJ,ae.CardCarouselPlugin=AZ,ae.CardListCircle=pd,ae.CardListCirclePlugin=_J,ae.CardListProgramme=hd,ae.CardListProgrammePlugin=yJ,ae.CardListSchool=fd,ae.CardListSchoolPlugin=wJ,ae.CardShowcase=ld,ae.CardShowcasePlugin=sJ,ae.CardShowcaseProfile=Lr,ae.CardShowcaseProfilePlugin=_Z,ae.CarouselLogo=jr,ae.CarouselLogoPlugin=XZ,ae.CollapseCustom=Bc,ae.CollapseCustomPlugin=NJ,ae.ContactUsInfo=Rr,ae.ContactUsInfoPlugin=zZ,ae.ContactUsList=vr,ae.ContactUsListPlugin=FZ,ae.CountDown=Ar,ae.CountDownPlugin=OZ,ae.CustomIframe=Ir,ae.CustomIframePlugin=UZ,ae.CustomSpace=yr,ae.CustomSpacePlugin=SZ,ae.CustomText=Jr,ae.CustomTextPlugin=uJ,ae.DetailLink=gd,ae.DetailLinkPlugin=CJ,ae.Disc=Wr,ae.DiscPlugin=QZ,ae.DonorLinks=kr,ae.DonorLinksPlugin=LZ,ae.ExploreLinks=sd,ae.ExploreLinksPlugin=rJ,ae.GalleryBlock=Kr,ae.GalleryBlockPlugin=nJ,ae.GalleryCaptionRound=js,ae.GalleryCaptionRoundPlugin=kZ,ae.GalleryDefault=Hs,ae.GalleryDefaultPlugin=xZ,ae.GalleryList=br,ae.GalleryListPlugin=BZ,ae.GalleryTimeline=hr,ae.GalleryTimelineCol=fr,ae.GalleryTimelineColPlugin=TZ,ae.GalleryTimelinePlugin=EZ,ae.GridLinks=Sp,ae.HeroSlide=Cr,ae.HeroSlidePlugin=PZ,ae.InformationLink=kc,ae.InformationLinkPlugin=VJ,ae.LinkList=Vr,ae.LinkListPlugin=DZ,ae.MapStatic=Hr,ae.MapStaticPlugin=WZ,ae.MediaImageFull=ed,ae.MediaImageFullPlugin=mJ,ae.MediaImageStatic=td,ae.MediaImageStaticPlugin=pJ,ae.MediaLogo=vl,ae.MediaLogoPlugin=eJ,ae.MediaVideo=xc,ae.MediaVideoPlugin=bJ,ae.NewsList=Dr,ae.NewsListPlugin=gZ,ae.Process=gr,ae.ProcessPlugin=NZ,ae.Publications=Fr,ae.PublicationsPlugin=qZ,ae.QuoteText=xr,ae.QuoteTextPlugin=$Z,ae.RegisterForm=Yr,ae.RegisterFormPlugin=tJ,ae.Resources=zr,ae.ResourcesPlugin=YZ,ae.ResourcesTwo=qr,ae.ResourcesTwoPlugin=KZ,ae.ResponsiveUtils=DJ,ae.RibbonBlock=Br,ae.RibbonBlockPlugin=hZ,ae.SchoolLayout=dd,ae.SchoolLayoutPlugin=dJ,ae.ScrollKeyInfo=Ur,ae.ScrollKeyInfoPlugin=jZ,ae.StorageUtils=$J,ae.TabDefault=ud,ae.TabDefaultPlugin=fJ,ae.TabLogo=Tc,ae.TabLogoPlugin=EJ,ae.TabPage=Ec,ae.TabPagePlugin=xJ,ae.TabTimeLine=md,ae.TabTimeLinePlugin=gJ,ae.TableCollapse=Xr,ae.TableCollapsePlugin=JZ,ae.TableTwo=Mr,ae.TableTwoPlugin=HZ,ae.TheHistoryCarousel=$r,ae.TheHistoryCarouselPlugin=yZ,ae.ThemeUtils=PJ,ae.TimelineStory=Pr,ae.TimelineStoryPlugin=fZ,ae.VrTour=Pc,ae.VrTourPlugin=SJ,ae.VueScreenPlugin=Kp,ae.default=LJ,ae.useTheme=BJ,ae.useVueScreen=Yy,Object.defineProperties(ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
533
|
+
`,r++,s=d}),this.end_=s,this.storage_=i,this.diagnostics_=l}calculateBaseTime_(t,o,a){if(!this.storage_.size)return 0;if(this.storage_.has(t))return this.storage_.get(t).segmentSyncInfo.start;const i=Math.min(...this.storage_.keys());if(t<i){const l=i-t;let s=this.storage_.get(i).segmentSyncInfo.start;for(let r=0;r<l;r++){const c=o[r];s-=c.duration}return s}return a}isReliablePlaylist_(t,o){return t!=null&&Array.isArray(o)&&o.length}}class F2 extends R2{constructor(t){super(),this.parent_=t}calculateBaseTime_(t,o,a){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(t);return i?i.segmentSyncInfo.start:0}return super.calculateBaseTime_(t,o,a)}}const rG=86400,Ep=[{name:"VOD",run:(n,t,o,a,i)=>o!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(n,t,o,a,i,l)=>{const s=n.getMediaSequenceSync(l);if(!s||!s.isReliable)return null;const r=s.getSyncInfoForTime(i);return r?{time:r.start,partIndex:r.partIndex,segmentIndex:r.segmentIndex}:null}},{name:"ProgramDateTime",run:(n,t,o,a,i)=>{if(!Object.keys(n.timelineToDatetimeMappings).length)return null;let l=null,s=null;const r=rp(t);i=i||0;for(let c=0;c<r.length;c++){const u=t.endList||i===0?c:r.length-(c+1),g=r[u],m=g.segment,d=n.timelineToDatetimeMappings[m.timeline];if(!d||!m.dateTimeObject)continue;let f=m.dateTimeObject.getTime()/1e3+d;if(m.parts&&typeof g.partIndex=="number")for(let V=0;V<g.partIndex;V++)f+=m.parts[V].duration;const h=Math.abs(i-f);if(s!==null&&(h===0||s<h))break;s=h,l={time:f,segmentIndex:g.segmentIndex,partIndex:g.partIndex}}return l}},{name:"Segment",run:(n,t,o,a,i)=>{let l=null,s=null;i=i||0;const r=rp(t);for(let c=0;c<r.length;c++){const u=t.endList||i===0?c:r.length-(c+1),g=r[u],m=g.segment,d=g.part&&g.part.start||m&&m.start;if(m.timeline===a&&typeof d<"u"){const p=Math.abs(i-d);if(s!==null&&s<p)break;(!l||s===null||s>=p)&&(s=p,l={time:d,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return l}},{name:"Discontinuity",run:(n,t,o,a,i)=>{let l=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length){let s=null;for(let r=0;r<t.discontinuityStarts.length;r++){const c=t.discontinuityStarts[r],u=t.discontinuitySequence+r+1,g=n.discontinuities[u];if(g){const m=Math.abs(i-g.time);if(s!==null&&s<m)break;(!l||s===null||s>=m)&&(s=m,l={time:g.time,segmentIndex:c,partIndex:null})}}}return l}},{name:"Playlist",run:(n,t,o,a,i)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class dG extends ie.EventTarget{constructor(t={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const o=new R2,a=new F2(o),i=new F2(o);this.mediaSequenceStorage_={main:o,audio:a,vtt:i},this.logger_=no("SyncController")}getMediaSequenceSync(t){return this.mediaSequenceStorage_[t]||null}getSyncPoint(t,o,a,i,l){if(o!==1/0)return Ep.find(({name:c})=>c==="VOD").run(this,t,o);const s=this.runStrategies_(t,o,a,i,l);if(!s.length)return null;for(const r of s){const{syncPoint:c,strategy:u}=r,{segmentIndex:g,time:m}=c;if(g<0)continue;const d=t.segments[g],p=m,f=p+d.duration;if(this.logger_(`Strategy: ${u}. Current time: ${i}. selected segment: ${g}. Time: [${p} -> ${f}]}`),i>=p&&i<f)return this.logger_("Found sync point with exact match: ",c),c}return this.selectSyncPoint_(s,{key:"time",value:i})}getExpiredTime(t,o){if(!t||!t.segments)return null;const a=this.runStrategies_(t,o,t.discontinuitySequence,0);if(!a.length)return null;const i=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+gs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:i.segmentIndex,endIndex:0}))}runStrategies_(t,o,a,i,l){const s=[];for(let r=0;r<Ep.length;r++){const c=Ep[r],u=c.run(this,t,o,a,i,l);u&&(u.strategy=c.name,s.push({strategy:c.name,syncPoint:u}))}return s}selectSyncPoint_(t,o){let a=t[0].syncPoint,i=Math.abs(t[0].syncPoint[o.key]-o.value),l=t[0].strategy;for(let s=1;s<t.length;s++){const r=Math.abs(t[s].syncPoint[o.key]-o.value);r<i&&(i=r,a=t[s].syncPoint,l=t[s].strategy)}return this.logger_(`syncPoint for [${o.key}: ${o.value}] chosen with strategy [${l}]: [time:${a.time}, segmentIndex:${a.segmentIndex}`+(typeof a.partIndex=="number"?`,partIndex:${a.partIndex}`:"")+"]"),a}saveExpiredSegmentInfo(t,o){const a=o.mediaSequence-t.mediaSequence;if(a>rG){ie.log.warn(`Not saving expired segment info. Media sequence gap ${a} is too large.`);return}for(let i=a-1;i>=0;i--){const l=t.segments[i];if(l&&typeof l.start<"u"){o.syncInfo={mediaSequence:t.mediaSequence+i,time:l.start},this.logger_(`playlist refresh sync: [time:${o.syncInfo.time}, mediaSequence: ${o.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(t){if(this.timelineToDatetimeMappings={},t.segments&&t.segments.length&&t.segments[0].dateTimeObject){const o=t.segments[0],a=o.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[o.timeline]=-a}}saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:o}){const a=this.calculateSegmentTimeMapping_(t,t.timingInfo,o),i=t.segment;a&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:i.start}));const l=i.dateTimeObject;i.discontinuity&&o&&l&&(this.timelineToDatetimeMappings[i.timeline]=-(l.getTime()/1e3))}timestampOffsetForTimeline(t){return typeof this.timelines[t]>"u"?null:this.timelines[t].time}mappingForTimeline(t){return typeof this.timelines[t]>"u"?null:this.timelines[t].mapping}calculateSegmentTimeMapping_(t,o,a){const i=t.segment,l=t.part;let s=this.timelines[t.timeline],r,c;if(typeof t.timestampOffset=="number")s={time:t.startOfSegment,mapping:t.startOfSegment-o.start},a&&(this.timelines[t.timeline]=s,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${t.timeline}: [time: ${s.time}] [mapping: ${s.mapping}]`)),r=t.startOfSegment,c=o.end+s.mapping;else if(s)r=o.start+s.mapping,c=o.end+s.mapping;else return!1;return l&&(l.start=r,l.end=c),(!i.start||r<i.start)&&(i.start=r),i.end=c,!0}saveDiscontinuitySyncInfo_(t){const o=t.playlist,a=t.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(o.discontinuityStarts&&o.discontinuityStarts.length)for(let i=0;i<o.discontinuityStarts.length;i++){const l=o.discontinuityStarts[i],s=o.discontinuitySequence+i+1,r=l-t.mediaIndex,c=Math.abs(r);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>c){let u;r<0?u=a.start-gs({defaultDuration:o.targetDuration,durationList:o.segments,startIndex:t.mediaIndex,endIndex:l}):u=a.end+gs({defaultDuration:o.targetDuration,durationList:o.segments,startIndex:t.mediaIndex+1,endIndex:l}),this.discontinuities[s]={time:u,accuracy:c}}}}dispose(){this.trigger("dispose"),this.off()}}class cG extends ie.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(t){this.pendingTimelineChanges_[t]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:t,from:o,to:a}){return typeof o=="number"&&typeof a=="number"&&(this.pendingTimelineChanges_[t]={type:t,from:o,to:a},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]}lastTimelineChange({type:t,from:o,to:a}){if(typeof o=="number"&&typeof a=="number"){this.lastTimelineChanges_[t]={type:t,from:o,to:a},delete this.pendingTimelineChanges_[t];const i={timelineChangeInfo:{from:o,to:a}};this.trigger({type:"timelinechange",metadata:i})}return this.lastTimelineChanges_[t]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const uG=p2(h2(function(){var n=function(){function h(){this.listeners={}}var V=h.prototype;return V.on=function(k,y){this.listeners[k]||(this.listeners[k]=[]),this.listeners[k].push(y)},V.off=function(k,y){if(!this.listeners[k])return!1;var b=this.listeners[k].indexOf(y);return this.listeners[k]=this.listeners[k].slice(0),this.listeners[k].splice(b,1),b>-1},V.trigger=function(k){var y=this.listeners[k];if(y)if(arguments.length===2)for(var b=y.length,C=0;C<b;++C)y[C].call(this,arguments[1]);else for(var E=Array.prototype.slice.call(arguments,1),x=y.length,N=0;N<x;++N)y[N].apply(this,E)},V.dispose=function(){this.listeners={}},V.pipe=function(k){this.on("data",function(y){k.push(y)})},h}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function t(h){return h.subarray(0,h.byteLength-h[h.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const o=function(){const h=[[[],[],[],[],[]],[[],[],[],[],[]]],V=h[0],w=h[1],k=V[4],y=w[4];let b,C,E;const x=[],N=[];let $,S,I,D,A,O;for(b=0;b<256;b++)N[(x[b]=b<<1^(b>>7)*283)^b]=b;for(C=E=0;!k[C];C^=$||1,E=N[E]||1)for(D=E^E<<1^E<<2^E<<3^E<<4,D=D>>8^D&255^99,k[C]=D,y[D]=C,I=x[S=x[$=x[C]]],O=I*16843009^S*65537^$*257^C*16843008,A=x[D]*257^D*16843008,b=0;b<4;b++)V[b][C]=A=A<<24^A>>>8,w[b][D]=O=O<<24^O>>>8;for(b=0;b<5;b++)V[b]=V[b].slice(0),w[b]=w[b].slice(0);return h};let a=null;class i{constructor(V){a||(a=o()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];let w,k,y;const b=this._tables[0][4],C=this._tables[1],E=V.length;let x=1;if(E!==4&&E!==6&&E!==8)throw new Error("Invalid aes key size");const N=V.slice(0),$=[];for(this._key=[N,$],w=E;w<4*E+28;w++)y=N[w-1],(w%E===0||E===8&&w%E===4)&&(y=b[y>>>24]<<24^b[y>>16&255]<<16^b[y>>8&255]<<8^b[y&255],w%E===0&&(y=y<<8^y>>>24^x<<24,x=x<<1^(x>>7)*283)),N[w]=N[w-E]^y;for(k=0;w;k++,w--)y=N[k&3?w:w-4],w<=4||k<4?$[k]=y:$[k]=C[0][b[y>>>24]]^C[1][b[y>>16&255]]^C[2][b[y>>8&255]]^C[3][b[y&255]]}decrypt(V,w,k,y,b,C){const E=this._key[1];let x=V^E[0],N=y^E[1],$=k^E[2],S=w^E[3],I,D,A;const O=E.length/4-2;let Q,X=4;const G=this._tables[1],M=G[0],q=G[1],U=G[2],R=G[3],H=G[4];for(Q=0;Q<O;Q++)I=M[x>>>24]^q[N>>16&255]^U[$>>8&255]^R[S&255]^E[X],D=M[N>>>24]^q[$>>16&255]^U[S>>8&255]^R[x&255]^E[X+1],A=M[$>>>24]^q[S>>16&255]^U[x>>8&255]^R[N&255]^E[X+2],S=M[S>>>24]^q[x>>16&255]^U[N>>8&255]^R[$&255]^E[X+3],X+=4,x=I,N=D,$=A;for(Q=0;Q<4;Q++)b[(3&-Q)+C]=H[x>>>24]<<24^H[N>>16&255]<<16^H[$>>8&255]<<8^H[S&255]^E[X++],I=x,x=N,N=$,$=S,S=I}}class l extends n{constructor(){super(n),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(V){this.jobs.push(V),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const s=function(h){return h<<24|(h&65280)<<8|(h&16711680)>>8|h>>>24},r=function(h,V,w){const k=new Int32Array(h.buffer,h.byteOffset,h.byteLength>>2),y=new i(Array.prototype.slice.call(V)),b=new Uint8Array(h.byteLength),C=new Int32Array(b.buffer);let E,x,N,$,S,I,D,A,O;for(E=w[0],x=w[1],N=w[2],$=w[3],O=0;O<k.length;O+=4)S=s(k[O]),I=s(k[O+1]),D=s(k[O+2]),A=s(k[O+3]),y.decrypt(S,I,D,A,C,O),C[O]=s(C[O]^E),C[O+1]=s(C[O+1]^x),C[O+2]=s(C[O+2]^N),C[O+3]=s(C[O+3]^$),E=S,x=I,N=D,$=A;return b};class c{constructor(V,w,k,y){const b=c.STEP,C=new Int32Array(V.buffer),E=new Uint8Array(V.byteLength);let x=0;for(this.asyncStream_=new l,this.asyncStream_.push(this.decryptChunk_(C.subarray(x,x+b),w,k,E)),x=b;x<C.length;x+=b)k=new Uint32Array([s(C[x-4]),s(C[x-3]),s(C[x-2]),s(C[x-1])]),this.asyncStream_.push(this.decryptChunk_(C.subarray(x,x+b),w,k,E));this.asyncStream_.push(function(){y(null,t(E))})}static get STEP(){return 32e3}decryptChunk_(V,w,k,y){return function(){const b=r(V,w,k);y.set(b,V.byteOffset)}}}var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g;typeof window<"u"?g=window:typeof u<"u"?g=u:typeof self<"u"?g=self:g={};var m=g,d=function(V){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(V):V&&V.buffer instanceof ArrayBuffer},p=m.BigInt||Number;p("0x1"),p("0x100"),p("0x10000"),p("0x1000000"),p("0x100000000"),p("0x10000000000"),p("0x1000000000000"),p("0x100000000000000"),p("0x10000000000000000"),function(){var h=new Uint16Array([65484]),V=new Uint8Array(h.buffer,h.byteOffset,h.byteLength);return V[0]===255?"big":V[0]===204?"little":"unknown"}();const f=function(h){const V={};return Object.keys(h).forEach(w=>{const k=h[w];d(k)?V[w]={bytes:k.buffer,byteOffset:k.byteOffset,byteLength:k.byteLength}:V[w]=k}),V};self.onmessage=function(h){const V=h.data,w=new Uint8Array(V.encrypted.bytes,V.encrypted.byteOffset,V.encrypted.byteLength),k=new Uint32Array(V.key.bytes,V.key.byteOffset,V.key.byteLength/4),y=new Uint32Array(V.iv.bytes,V.iv.byteOffset,V.iv.byteLength/4);new c(w,k,y,function(b,C){self.postMessage(f({source:V.source,decrypted:C}),[C.buffer])})}}));var mG=m2(uG);const pG=n=>{let t=n.default?"main":"alternative";return n.characteristics&&n.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},H2=(n,t)=>{n.abort(),n.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Tp=(n,t)=>{t.activePlaylistLoader=n,n.load()},hG=(n,t)=>()=>{const{segmentLoaders:{[n]:o,main:a},mediaTypes:{[n]:i}}=t,l=i.activeTrack(),s=i.getActiveGroup(),r=i.activePlaylistLoader,c=i.lastGroup_;if(!(s&&c&&s.id===c.id)&&(i.lastGroup_=s,i.lastTrack_=l,H2(o,i),!(!s||s.isMainPlaylist))){if(!s.playlistLoader){r&&a.resetEverything();return}o.resyncLoader(),Tp(s.playlistLoader,i)}},fG=(n,t)=>()=>{const{segmentLoaders:{[n]:o},mediaTypes:{[n]:a}}=t;a.lastGroup_=null,o.abort(),o.pause()},gG=(n,t)=>()=>{const{mainPlaylistLoader:o,segmentLoaders:{[n]:a,main:i},mediaTypes:{[n]:l}}=t,s=l.activeTrack(),r=l.getActiveGroup(),c=l.activePlaylistLoader,u=l.lastTrack_;if(!(u&&s&&u.id===s.id)&&(l.lastGroup_=r,l.lastTrack_=s,H2(a,l),!!r)){if(r.isMainPlaylist){if(!s||!u||s.id===u.id)return;const g=t.vhs.playlistController_,m=g.selectPlaylist();if(g.media()===m)return;l.logger_(`track change. Switching main audio from ${u.id} to ${s.id}`),o.pause(),i.resetEverything(),g.fastQualityChange_(m);return}if(n==="AUDIO"){if(!r.playlistLoader){i.setAudio(!0),i.resetEverything();return}a.setAudio(!0),i.setAudio(!1)}if(c===r.playlistLoader){Tp(r.playlistLoader,l);return}a.track&&a.track(s),a.resetEverything(),Tp(r.playlistLoader,l)}},Cc={AUDIO:(n,t)=>()=>{const{mediaTypes:{[n]:o},excludePlaylist:a}=t,i=o.activeTrack(),l=o.activeGroup(),s=(l.filter(c=>c.default)[0]||l[0]).id,r=o.tracks[s];if(i===r){a({error:{message:"Problem encountered loading the default audio track."}});return}ie.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const c in o.tracks)o.tracks[c].enabled=o.tracks[c]===r;o.onTrackChanged()},SUBTITLES:(n,t)=>()=>{const{mediaTypes:{[n]:o}}=t;ie.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const a=o.activeTrack();a&&(a.mode="disabled"),o.onTrackChanged()}},j2={AUDIO:(n,t,o)=>{if(!t)return;const{tech:a,requestOptions:i,segmentLoaders:{[n]:l}}=o;t.on("loadedmetadata",()=>{const s=t.media();l.playlist(s,i),(!a.paused()||s.endList&&a.preload()!=="none")&&l.load()}),t.on("loadedplaylist",()=>{l.playlist(t.media(),i),a.paused()||l.load()}),t.on("error",Cc[n](n,o))},SUBTITLES:(n,t,o)=>{const{tech:a,requestOptions:i,segmentLoaders:{[n]:l},mediaTypes:{[n]:s}}=o;t.on("loadedmetadata",()=>{const r=t.media();l.playlist(r,i),l.track(s.activeTrack()),(!a.paused()||r.endList&&a.preload()!=="none")&&l.load()}),t.on("loadedplaylist",()=>{l.playlist(t.media(),i),a.paused()||l.load()}),t.on("error",Cc[n](n,o))}},yG={AUDIO:(n,t)=>{const{vhs:o,sourceType:a,segmentLoaders:{[n]:i},requestOptions:l,main:{mediaGroups:s},mediaTypes:{[n]:{groups:r,tracks:c,logger_:u}},mainPlaylistLoader:g}=t,m=ys(g.main);(!s[n]||Object.keys(s[n]).length===0)&&(s[n]={main:{default:{default:!0}}},m&&(s[n].main.default.playlists=g.main.playlists));for(const d in s[n]){r[d]||(r[d]=[]);for(const p in s[n][d]){let f=s[n][d][p],h;if(m?(u(`AUDIO group '${d}' label '${p}' is a main playlist`),f.isMainPlaylist=!0,h=null):a==="vhs-json"&&f.playlists?h=new ol(f.playlists[0],o,l):f.resolvedUri?h=new ol(f.resolvedUri,o,l):f.playlists&&a==="dash"?h=new yp(f.playlists[0],o,l,g):h=null,f=at({id:p,playlistLoader:h},f),j2[n](n,f.playlistLoader,t),r[d].push(f),typeof c[p]>"u"){const V=new ie.AudioTrack({id:p,kind:pG(f),enabled:!1,language:f.language,default:f.default,label:p});c[p]=V}}}i.on("error",Cc[n](n,t))},SUBTITLES:(n,t)=>{const{tech:o,vhs:a,sourceType:i,segmentLoaders:{[n]:l},requestOptions:s,main:{mediaGroups:r},mediaTypes:{[n]:{groups:c,tracks:u}},mainPlaylistLoader:g}=t;for(const m in r[n]){c[m]||(c[m]=[]);for(const d in r[n][m]){if(!a.options_.useForcedSubtitles&&r[n][m][d].forced)continue;let p=r[n][m][d],f;if(i==="hls")f=new ol(p.resolvedUri,a,s);else if(i==="dash"){if(!p.playlists.filter(V=>V.excludeUntil!==1/0).length)return;f=new yp(p.playlists[0],a,s,g)}else i==="vhs-json"&&(f=new ol(p.playlists?p.playlists[0]:p.resolvedUri,a,s));if(p=at({id:d,playlistLoader:f},p),j2[n](n,p.playlistLoader,t),c[m].push(p),typeof u[d]>"u"){const h=o.addRemoteTextTrack({id:d,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:d},!1).track;u[d]=h}}}l.on("error",Cc[n](n,t))},"CLOSED-CAPTIONS":(n,t)=>{const{tech:o,main:{mediaGroups:a},mediaTypes:{[n]:{groups:i,tracks:l}}}=t;for(const s in a[n]){i[s]||(i[s]=[]);for(const r in a[n][s]){const c=a[n][s][r];if(!/^(?:CC|SERVICE)/.test(c.instreamId))continue;const u=o.options_.vhs&&o.options_.vhs.captionServices||{};let g={label:r,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(u[g.instreamId]&&(g=at(g,u[g.instreamId])),g.default===void 0&&delete g.default,i[s].push(at({id:r},c)),typeof l[r]>"u"){const m=o.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;l[r]=m}}}}},z2=(n,t)=>{for(let o=0;o<n.length;o++)if(up(t,n[o])||n[o].playlists&&z2(n[o].playlists,t))return!0;return!1},_G=(n,t)=>o=>{const{mainPlaylistLoader:a,mediaTypes:{[n]:{groups:i}}}=t,l=a.media();if(!l)return null;let s=null;l.attributes[n]&&(s=i[l.attributes[n]]);const r=Object.keys(i);if(!s)if(n==="AUDIO"&&r.length>1&&ys(t.main))for(let c=0;c<r.length;c++){const u=i[r[c]];if(z2(u,l)){s=u;break}}else i.main?s=i.main:r.length===1&&(s=i[r[0]]);return typeof o>"u"?s:o===null||!s?null:s.filter(c=>c.id===o.id)[0]||null},wG={AUDIO:(n,t)=>()=>{const{mediaTypes:{[n]:{tracks:o}}}=t;for(const a in o)if(o[a].enabled)return o[a];return null},SUBTITLES:(n,t)=>()=>{const{mediaTypes:{[n]:{tracks:o}}}=t;for(const a in o)if(o[a].mode==="showing"||o[a].mode==="hidden")return o[a];return null}},bG=(n,{mediaTypes:t})=>()=>{const o=t[n].activeTrack();return o?t[n].activeGroup(o):null},CG=n=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{yG[u](u,n)});const{mediaTypes:t,mainPlaylistLoader:o,tech:a,vhs:i,segmentLoaders:{["AUDIO"]:l,main:s}}=n;["AUDIO","SUBTITLES"].forEach(u=>{t[u].activeGroup=_G(u,n),t[u].activeTrack=wG[u](u,n),t[u].onGroupChanged=hG(u,n),t[u].onGroupChanging=fG(u,n),t[u].onTrackChanged=gG(u,n),t[u].getActiveGroup=bG(u,n)});const r=t.AUDIO.activeGroup();if(r){const u=(r.filter(m=>m.default)[0]||r[0]).id;t.AUDIO.tracks[u].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(s.setAudio(!1),l.setAudio(!0)):s.setAudio(!0)}o.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(u=>t[u].onGroupChanged())}),o.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(u=>t[u].onGroupChanging())});const c=()=>{t.AUDIO.onTrackChanged(),a.trigger({type:"usage",name:"vhs-audio-change"})};a.audioTracks().addEventListener("change",c),a.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",()=>{a.audioTracks().removeEventListener("change",c),a.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),a.clearTracks("audio");for(const u in t.AUDIO.tracks)a.audioTracks().addTrack(t.AUDIO.tracks[u])},VG=()=>{const n={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{n[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Zo,activeTrack:Zo,getActiveGroup:Zo,onGroupChanged:Zo,onTrackChanged:Zo,lastTrack_:null,logger_:no(`MediaGroups[${t}]`)}}),n};class q2{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(t){t===1&&(this.version_=t)}set ttl(t){this.ttl_=t||300}set reloadUri(t){t&&(this.reloadUri_=Nn(this.reloadUri_,t))}set priority(t){t&&t.length&&(this.priority_=t)}set pathwayClones(t){t&&t.length&&(this.pathwayClones_=new Map(t.map(o=>[o.ID,o])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class xG extends ie.EventTarget{constructor(t,o){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new q2,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=no("Content Steering"),this.xhr_=t,this.getBandwidth_=o}assignTagProperties(t,o){this.manifestType_=o.serverUri?"HLS":"DASH";const a=o.serverUri||o.serverURL;if(!a){this.logger_(`steering manifest URL is ${a}, cannot request steering manifest.`),this.trigger("error");return}if(a.startsWith("data:")){this.decodeDataUriManifest_(a.substring(a.indexOf(",")+1));return}this.steeringManifest.reloadUri=Nn(t,a),this.defaultPathway=o.pathwayId||o.defaultServiceLocation,this.queryBeforeStart=o.queryBeforeStart,this.proxyServerUrl_=o.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(t){const o=this.steeringManifest.reloadUri;if(!o)return;const a=t?o:this.getRequestURI(o);if(!a){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const i={contentSteeringInfo:{uri:a}};this.trigger({type:"contentsteeringloadstart",metadata:i}),this.request_=this.xhr_({uri:a,requestType:"content-steering-manifest"},(l,s)=>{if(l){if(s.status===410){this.logger_(`manifest request 410 ${l}.`),this.logger_(`There will be no more content steering requests to ${a} this session.`),this.excludedSteeringManifestURLs.add(a);return}if(s.status===429){const u=s.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${l}.`),this.logger_(`content steering will retry in ${u} seconds.`),this.startTTLTimeout_(parseInt(u,10));return}this.logger_(`manifest failed to load ${l}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:i});let r;try{r=JSON.parse(this.request_.responseText)}catch(u){const g={errorType:ie.Error.StreamingContentSteeringParserError,error:u};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(r);const c={contentSteeringInfo:i.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:c}),this.startTTLTimeout_()})}setProxyServerUrl_(t){const o=new K.URL(t),a=new K.URL(this.proxyServerUrl_);return a.searchParams.set("url",encodeURI(o.toString())),this.setSteeringParams_(a.toString())}decodeDataUriManifest_(t){const o=JSON.parse(K.atob(t));this.assignSteeringProperties_(o)}setSteeringParams_(t){const o=new K.URL(t),a=this.getPathway(),i=this.getBandwidth_();if(a){const l=`_${this.manifestType_}_pathway`;o.searchParams.set(l,a)}if(i){const l=`_${this.manifestType_}_throughput`;o.searchParams.set(l,i)}return o.toString()}assignSteeringProperties_(t){if(this.steeringManifest.version=t.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${t.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=t.TTL,this.steeringManifest.reloadUri=t["RELOAD-URI"],this.steeringManifest.priority=t["PATHWAY-PRIORITY"]||t["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=t["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const a=(i=>{for(const l of i)if(this.availablePathways_.has(l))return l;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==a&&(this.currentPathway=a,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(t){if(!t)return null;const o=i=>this.excludedSteeringManifestURLs.has(i);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(t);if(!o(i))return i}const a=this.setSteeringParams_(t);return o(a)?null:a}startTTLTimeout_(t=this.steeringManifest.ttl){const o=t*1e3;this.ttlTimeout_=K.setTimeout(()=>{this.requestSteeringManifest()},o)}clearTTLTimeout_(){K.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new q2}addAvailablePathway(t){t&&this.availablePathways_.add(t)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(t){return this.availablePathways_.delete(t)}didDASHTagChange(t,o){return!o&&this.steeringManifest.reloadUri||o&&(Nn(t,o.serverURL)!==this.steeringManifest.reloadUri||o.defaultServiceLocation!==this.defaultPathway||o.queryBeforeStart!==this.queryBeforeStart||o.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const kG=(n,t)=>{let o=null;return(...a)=>{clearTimeout(o),o=setTimeout(()=>{n.apply(null,a)},t)}},EG=10;let Ca;const TG=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],NG=function(n){return this.audioSegmentLoader_[n]+this.mainSegmentLoader_[n]},SG=function({currentPlaylist:n,buffered:t,currentTime:o,nextPlaylist:a,bufferLowWaterLine:i,bufferHighWaterLine:l,duration:s,bufferBasedABR:r,log:c}){if(!a)return ie.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${n&&n.id||"null"} -> ${a.id}`;if(!n)return c(`${u} as current playlist is not set`),!0;if(a.id===n.id)return!1;const g=!!el(t,o).length;if(!n.endList)return!g&&typeof n.partTargetDuration=="number"?(c(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${u} as current playlist is live`),!0);const m=lp(t,o),d=r?zt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:zt.MAX_BUFFER_LOW_WATER_LINE;if(s<d)return c(`${u} as duration < max low water line (${s} < ${d})`),!0;const p=a.attributes.BANDWIDTH,f=n.attributes.BANDWIDTH;if(p<f&&(!r||m<l)){let h=`${u} as next bandwidth < current bandwidth (${p} < ${f})`;return r&&(h+=` and forwardBuffer < bufferHighWaterLine (${m} < ${l})`),c(h),!0}if((!r||p>f)&&m>=i){let h=`${u} as forwardBuffer >= bufferLowWaterLine (${m} >= ${i})`;return r&&(h+=` and next bandwidth > current bandwidth (${p} > ${f})`),c(h),!0}return c(`not ${u} as no switching criteria met`),!1};class BG extends ie.EventTarget{constructor(t){super(),this.fastQualityChange_=kG(this.fastQualityChange_.bind(this),100);const{src:o,withCredentials:a,tech:i,bandwidth:l,externVhs:s,useCueTags:r,playlistExclusionDuration:c,enableLowInitialPlaylist:u,sourceType:g,cacheEncryptionKeys:m,bufferBasedABR:d,leastPixelDiffSelector:p,captionServices:f,experimentalUseMMS:h}=t;if(!o)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:V}=t;(V===null||typeof V>"u")&&(V=1/0),Ca=s,this.bufferBasedABR=!!d,this.leastPixelDiffSelector=!!p,this.withCredentials=a,this.tech_=i,this.vhs_=i.vhs,this.player_=t.player_,this.sourceType_=g,this.useCueTags_=r,this.playlistExclusionDuration=c,this.maxPlaylistRetries=V,this.enableLowInitialPlaylist=u,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:a,maxPlaylistRetries:V,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=VG(),h&&K.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new K.ManagedMediaSource,this.usingManagedMediaSource_=!0,ie.log("Using ManagedMediaSource")):K.MediaSource&&(this.mediaSource=new K.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=jt(),this.hasPlayed_=!1,this.syncController_=new dG(t),this.segmentMetadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new mG,this.sourceUpdater_=new v2(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new cG,this.keyStatusMap_=new Map;const w={vhs:this.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:f,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:l,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:m,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:t.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new yp(o,this.vhs_,at(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new ol(o,this.vhs_,at(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new xp(at(w,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),t),this.audioSegmentLoader_=new xp(at(w,{loaderType:"audio"}),t),this.subtitleSegmentLoader_=new aG(at(w,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((b,C)=>{function E(){i.off("vttjserror",x),b()}function x(){i.off("vttjsloaded",E),C()}i.one("vttjsloaded",E),i.one("vttjserror",x),i.addWebVttScript_()})}),t);const k=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new xG(this.vhs_.xhr,k),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),TG.forEach(b=>{this[b+"_"]=NG.bind(this,b)}),this.logger_=no("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(y,()=>{const b=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-b,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const t=this.mainAppendsToLoadedData_(),o=this.audioAppendsToLoadedData_();return t===-1||o===-1?-1:t+o}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(t="abr"){const o=this.selectPlaylist();o&&this.shouldSwitchToMedia_(o)&&this.switchMedia_(o,t)}switchMedia_(t,o,a){const i=this.media(),l=i&&(i.id||i.uri),s=t&&(t.id||t.uri);if(l&&l!==s){this.logger_(`switch media ${l} -> ${s} from ${o}`);const r={renditionInfo:{id:s,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:o};this.trigger({type:"renditionselected",metadata:r}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${o}`})}this.mainPlaylistLoader_.media(t,a)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{const o=this.mediaTypes_[t],a=o?o.activeGroup():null,i=this.contentSteeringController_.getPathway();if(a&&i){const s=(a.length?a[0].playlists:a.playlists).filter(r=>r.attributes.serviceLocation===i);s.length&&this.mediaTypes_[t].activePlaylistLoader.media(s[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=K.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(K.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const t=this.main(),o=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return o;const a=t.mediaGroups.AUDIO,i=Object.keys(a);let l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{const r=a.main||i.length&&a[i[0]];for(const c in r)if(r[c].default){l={label:c};break}}if(!l)return o;const s=[];for(const r in a)if(a[r][l.label]){const c=a[r][l.label];if(c.playlists&&c.playlists.length)s.push.apply(s,c.playlists);else if(c.uri)s.push(c);else if(t.playlists.length)for(let u=0;u<t.playlists.length;u++){const g=t.playlists[u];g.attributes&&g.attributes.AUDIO&&g.attributes.AUDIO===r&&s.push(g)}}return s.length?s:o}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const o=this.mainPlaylistLoader_.media(),a=o.targetDuration*1.5*1e3;cp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=a,o.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(o,this.requestOptions_),this.mainSegmentLoader_.load()),CG({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),o),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let o=this.mainPlaylistLoader_.media();if(!o){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let a;if(this.enableLowInitialPlaylist&&(a=this.selectInitialPlaylist()),a||(a=this.selectPlaylist()),!a||!this.shouldSwitchToMedia_(a)||(this.initialMedia_=a,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;o=this.initialMedia_}this.handleUpdatedMediaPlaylist(o)}),this.mainPlaylistLoader_.on("error",()=>{const o=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:o.playlist,error:o})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const o=this.mainPlaylistLoader_.media(),a=o.targetDuration*1.5*1e3;cp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=a,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(o,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const o=this.mainPlaylistLoader_.media();if(o.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(o)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(o=>{this.mainPlaylistLoader_.on(o,a=>{this.player_.trigger(Et({},a))})})}handleUpdatedMediaPlaylist(t){this.useCueTags_&&this.updateAdCues_(t),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!t.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(t,o){const a=t.mediaGroups||{};let i=!0;const l=Object.keys(a.AUDIO);for(const s in a.AUDIO)for(const r in a.AUDIO[s])a.AUDIO[s][r].uri||(i=!1);i&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(a.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Ca.Playlist.isAes(o)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),l.length&&Object.keys(a.AUDIO[l[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(t){const o=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),i=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),s=this.tech_.buffered();return SG({buffered:s,currentTime:a,currentPlaylist:o,nextPlaylist:t,bufferLowWaterLine:i,bufferHighWaterLine:l,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const a=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:a.playlist,error:a})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const a=this.audioSegmentLoader_.pendingSegment_;if(!a||!a.segment||!a.segment.syncInfo)return;const i=a.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",a=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:EG}))});const t=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const a=this.getCodecsOrExclude_();a&&this.sourceUpdater_.addOrChangeSourceBuffers(a)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(a=>{this.mainSegmentLoader_.on(a,i=>{this.player_.trigger(Et({},i))}),this.audioSegmentLoader_.on(a,i=>{this.player_.trigger(Et({},i))}),this.subtitleSegmentLoader_.on(a,i=>{this.player_.trigger(Et({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(t=this.selectPlaylist()){if(t&&t===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(t,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const t=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<t.start(0))return this.tech_.setCurrentTime(t.end(t.length-1))}setupFirstPlay(){const t=this.mainPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList||t.start){const o=this.seekable();if(!o.length)return!1;const a=o.end(0);let i=a;if(t.start){const l=t.start.timeOffset;l<0?i=Math.max(a+l,o.start(0)):i=Math.min(a,l)}this.trigger("firstplay"),this.tech_.setCurrentTime(i)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const t=this.tech_.play();typeof t<"u"&&typeof t.then=="function"&&t.then(null,o=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const t=this.inbandTextTracks_.metadataTrack_.cues;if(!t||!t.length)return;const o=this.duration();t[t.length-1].endTime=isNaN(o)||Math.abs(o)===1/0?Number.MAX_VALUE:o}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const o=this.mainSegmentLoader_.getCurrentMediaInfo_();!o||o.hasVideo?t=t&&this.audioSegmentLoader_.ended_:t=this.audioSegmentLoader_.ended_}t&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(t){if(!this.seekable().length)return!1;const a=this.syncController_.getExpiredTime(t,this.duration());if(a===null)return!1;const i=Ca.Playlist.playlistEnd(t,a),l=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-l<=Do;const r=s.end(s.length-1);return r-l<=Do&&i-r<=Do}excludePlaylist({playlistToExclude:t=this.mainPlaylistLoader_.media(),error:o={},playlistExclusionDuration:a}){if(t=t||this.mainPlaylistLoader_.media(),a=a||o.playlistExclusionDuration||this.playlistExclusionDuration,!t){this.error=o,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}t.playlistErrors_++;const i=this.mainPlaylistLoader_.main.playlists,l=i.filter(yc),s=l.length===1&&l[0]===t;if(i.length===1&&a!==1/0)return ie.log.warn(`Problem encountered with playlist ${t.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(s);if(s){if(this.main().contentSteering){const f=this.pathwayAttribute_(t),h=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(f),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(f)},h);return}let p=!1;i.forEach(f=>{if(f===t)return;const h=f.excludeUntil;typeof h<"u"&&h!==1/0&&(p=!0,delete f.excludeUntil)}),p&&(ie.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let r;t.playlistErrors_>this.maxPlaylistRetries?r=1/0:r=Date.now()+a*1e3,t.excludeUntil=r,o.reason&&(t.lastExcludeReason_=o.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const c=this.selectPlaylist();if(!c){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const u=o.internal?this.logger_:ie.log.warn,g=o.message?" "+o.message:"";u(`${o.internal?"Internal problem":"Problem"} encountered with playlist ${t.id}.${g} Switching to playlist ${c.id}.`),c.attributes.AUDIO!==t.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),c.attributes.SUBTITLES!==t.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const m=c.targetDuration/2*1e3||5*1e3,d=typeof c.lastRequest=="number"&&Date.now()-c.lastRequest<=m;return this.switchMedia_(c,"exclude",s||d)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(t,o){const a=[],i=t==="all";(i||t==="main")&&a.push(this.mainPlaylistLoader_);const l=[];(i||t==="audio")&&l.push("AUDIO"),(i||t==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(s=>{const r=this.mediaTypes_[s]&&this.mediaTypes_[s].activePlaylistLoader;r&&a.push(r)}),["main","audio","subtitle"].forEach(s=>{const r=this[`${s}SegmentLoader_`];r&&(t===s||t==="all")&&a.push(r)}),a.forEach(s=>o.forEach(r=>{typeof s[r]=="function"&&s[r]()}))}setCurrentTime(t){const o=el(this.tech_.buffered(),t);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(o&&o.length)return t;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const t=this.mainPlaylistLoader_.media();return t?t.endList?this.mediaSource?this.mediaSource.duration:Ca.Playlist.duration(t):1/0:0}seekable(){return this.seekable_}getSeekableRange_(t,o){const a=t.media();if(!a)return null;const i=this.syncController_.getMediaSequenceSync(o);if(i&&i.isReliable){const r=i.start,c=i.end;if(!isFinite(r)||!isFinite(c))return null;const u=Ca.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,a),g=Math.max(r,c-u);return jt([[r,g]])}const l=this.syncController_.getExpiredTime(a,this.duration());if(l===null)return null;const s=Ca.Playlist.seekable(a,l,Ca.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,a));return s.length?s:null}computeFinalSeekable_(t,o){if(!o)return t;const a=t.start(0),i=t.end(0),l=o.start(0),s=o.end(0);return l>i||a>s?t:jt([[Math.max(a,l),Math.min(i,s)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const t=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!t)return;let o;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(o=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!o))return;const a=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(t,o),!this.seekable_||a&&a.length&&this.seekable_.length&&a.start(0)===this.seekable_.start(0)&&a.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${A0(this.seekable_)}]`);const i={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:i}),this.tech_.trigger("seekablechanged")}updateDuration(t){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,t),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(t){const i=this.seekable();if(!i.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<i.end(i.length-1))&&this.sourceUpdater_.setDuration(i.end(i.length-1));return}const o=this.tech_.buffered();let a=Ca.Playlist.duration(this.mainPlaylistLoader_.media());o.length>0&&(a=Math.max(a,o.end(o.length-1))),this.mediaSource.duration!==a&&this.sourceUpdater_.setDuration(a)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(t=>{const o=this.mediaTypes_[t].groups;for(const a in o)o[a].forEach(i=>{i.playlistLoader&&i.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const t=!!this.mediaTypes_.AUDIO.activePlaylistLoader,o=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=t?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!o||!a)}getCodecsOrExclude_(){const t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},o=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;const a=ws(this.main(),o),i={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(i.video=a.video||t.main.videoCodec||JF),t.main.isMuxed&&(i.video+=`,${a.audio||t.main.audioCodec||Pf}`),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||l)&&(i.audio=a.audio||t.main.audioCodec||t.audio.audioCodec||Pf,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!i.audio&&!i.video){this.excludePlaylist({playlistToExclude:o,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const s=(u,g)=>u?Hl(g,this.usingManagedMediaSource_):Ru(g),r={};let c;if(["video","audio"].forEach(function(u){if(i.hasOwnProperty(u)&&!s(t[u].isFmp4,i[u])){const g=t[u].isFmp4?"browser":"muxer";r[g]=r[g]||[],r[g].push(i[u]),u==="audio"&&(c=g)}}),l&&c&&o.attributes.AUDIO){const u=o.attributes.AUDIO;this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===u&&g!==o&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${u} as ${c} does not support codec(s): "${i.audio}"`)}if(Object.keys(r).length){const u=Object.keys(r).reduce((g,m)=>(g&&(g+=", "),g+=`${m} does not support codec(s): "${r[m].join(",")}"`,g),"")+".";this.excludePlaylist({playlistToExclude:o,error:{internal:!0,message:u},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];if(["video","audio"].forEach(g=>{const m=(Vo(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,d=(Vo(i[g]||"")[0]||{}).type;m&&d&&m.toLowerCase()!==d.toLowerCase()&&u.push(`"${this.sourceUpdater_.codecs[g]}" -> "${i[g]}"`)}),u.length){this.excludePlaylist({playlistToExclude:o,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return i}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const t=this.getCodecsOrExclude_();if(!t)return;this.sourceUpdater_.createSourceBuffers(t);const o=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(o)}excludeUnsupportedVariants_(){const t=this.main().playlists,o=[];Object.keys(t).forEach(a=>{const i=t[a];if(o.indexOf(i.id)!==-1)return;o.push(i.id);const l=ws(this.main,i),s=[];l.audio&&!Ru(l.audio)&&!Hl(l.audio,this.usingManagedMediaSource_)&&s.push(`audio codec ${l.audio}`),l.video&&!Ru(l.video)&&!Hl(l.video,this.usingManagedMediaSource_)&&s.push(`video codec ${l.video}`),l.text&&l.text==="stpp.ttml.im1t"&&s.push(`text codec ${l.text}`),s.length&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: ${s.join(", ")}`))})}excludeIncompatibleVariants_(t){const o=[],a=this.main().playlists,i=_s(Vo(t)),l=Z0(i),s=i.video&&Vo(i.video)[0]||null,r=i.audio&&Vo(i.audio)[0]||null;Object.keys(a).forEach(c=>{const u=a[c];if(o.indexOf(u.id)!==-1||u.excludeUntil===1/0)return;o.push(u.id);const g=[],m=ws(this.mainPlaylistLoader_.main,u),d=Z0(m);if(!(!m.audio&&!m.video)){if(d!==l&&g.push(`codec count "${d}" !== "${l}"`),!this.sourceUpdater_.canChangeType()){const p=m.video&&Vo(m.video)[0]||null,f=m.audio&&Vo(m.audio)[0]||null;p&&s&&p.type.toLowerCase()!==s.type.toLowerCase()&&g.push(`video codec "${p.type}" !== "${s.type}"`),f&&r&&f.type.toLowerCase()!==r.type.toLowerCase()&&g.push(`audio codec "${f.type}" !== "${r.type}"`)}g.length&&(u.excludeUntil=1/0,this.logger_(`excluding ${u.id}: ${g.join(" && ")}`))}})}updateAdCues_(t){let o=0;const a=this.seekable();a.length&&(o=a.start(0)),lG(t,this.cueTagsTrack_,o)}goalBufferLength(){const t=this.tech_.currentTime(),o=zt.GOAL_BUFFER_LENGTH,a=zt.GOAL_BUFFER_LENGTH_RATE,i=Math.max(o,zt.MAX_GOAL_BUFFER_LENGTH);return Math.min(o+t*a,i)}bufferLowWaterLine(){const t=this.tech_.currentTime(),o=zt.BUFFER_LOW_WATER_LINE,a=zt.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(o,zt.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(o,zt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(o+t*a,this.bufferBasedABR?l:i)}bufferHighWaterLine(){return zt.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(t){B2(this.inbandTextTracks_,"com.apple.streaming",this.tech_),UW({inbandTextTracks:this.inbandTextTracks_,dateRanges:t})}addMetadataToTextTrack(t,o,a){const i=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();B2(this.inbandTextTracks_,t,this.tech_),vW({inbandTextTracks:this.inbandTextTracks_,metadataArray:o,timestampOffset:i,videoDuration:a})}pathwayAttribute_(t){return t.attributes["PATHWAY-ID"]||t.attributes.serviceLocation}initContentSteeringController_(){const t=this.main();if(t.contentSteering){for(const o of t.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(o));if(this.contentSteeringController_.assignTagProperties(t.uri,t.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(o=>{this.contentSteeringController_.on(o,a=>{this.trigger(Et({},a))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const o=this.main();(this.contentSteeringController_.didDASHTagChange(o.uri,o.contentSteering)||(()=>{const l=this.contentSteeringController_.getAvailablePathways(),s=[];for(const r of o.playlists){const c=r.attributes.serviceLocation;if(c&&(s.push(c),!l.has(c)))return!0}return!!(!s.length&&l.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const t=this.contentSteeringController_.getPathway();if(!t)return;this.handlePathwayClones_();const a=this.main().playlists,i=new Set;let l=!1;Object.keys(a).forEach(s=>{const r=a[s],c=this.pathwayAttribute_(r),u=c&&t!==c;r.excludeUntil===1/0&&r.lastExcludeReason_==="content-steering"&&!u&&(delete r.excludeUntil,delete r.lastExcludeReason_,l=!0);const m=!r.excludeUntil&&r.excludeUntil!==1/0;!i.has(r.id)&&u&&m&&(i.add(r.id),r.excludeUntil=1/0,r.lastExcludeReason_="content-steering",this.logger_(`excluding ${r.id} for ${r.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(s=>{const r=this.mediaTypes_[s];if(r.activePlaylistLoader){const c=r.activePlaylistLoader.media_;c&&c.attributes.serviceLocation!==t&&(l=!0)}}),l&&this.changeSegmentPathway_()}handlePathwayClones_(){const o=this.main().playlists,a=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(a&&a.size||i&&i.size){for(const[s,r]of a.entries())i.get(s)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(s));for(const[s,r]of i.entries()){const c=a.get(s);if(!c){o.filter(g=>g.attributes["PATHWAY-ID"]===r["BASE-ID"]).forEach(g=>{this.mainPlaylistLoader_.addClonePathway(r,g)}),this.contentSteeringController_.addAvailablePathway(s);continue}this.equalPathwayClones_(c,r)||(this.mainPlaylistLoader_.updateOrDeleteClone(r,!0),this.contentSteeringController_.addAvailablePathway(s))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(t,o){if(t["BASE-ID"]!==o["BASE-ID"]||t.ID!==o.ID||t["URI-REPLACEMENT"].HOST!==o["URI-REPLACEMENT"].HOST)return!1;const a=t["URI-REPLACEMENT"].PARAMS,i=o["URI-REPLACEMENT"].PARAMS;for(const l in a)if(a[l]!==i[l])return!1;for(const l in i)if(a[l]!==i[l])return!1;return!0}changeSegmentPathway_(){const t=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(t,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let t=0;const o="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(a=>{const i=this.mainPlaylistLoader_.getKeyIdSet(a);!i||!i.size||i.forEach(l=>{const s="usable",r=this.keyStatusMap_.has(l)&&this.keyStatusMap_.get(l)===s,c=a.lastExcludeReason_===o&&a.excludeUntil===1/0;r?r&&c&&(delete a.excludeUntil,delete a.lastExcludeReason_,this.logger_(`enabling playlist ${a.id} because key ID ${l} is ${s}`)):(a.excludeUntil!==1/0&&a.lastExcludeReason_!==o&&(a.excludeUntil=1/0,a.lastExcludeReason_=o,this.logger_(`excluding playlist ${a.id} because the key ID ${l} doesn't exist in the keyStatusMap or is not ${s}`)),t++)})}),t>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(a=>{const i=a&&a.attributes&&a.attributes.RESOLUTION&&a.attributes.RESOLUTION.height<720,l=a.excludeUntil===1/0&&a.lastExcludeReason_===o;i&&l&&(delete a.excludeUntil,ie.log.warn(`enabling non-HD playlist ${a.id} because all playlists were excluded due to ${o} key IDs`))})}addKeyStatus_(t,o){const l=(typeof t=="string"?t:nG(t)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${o}' with key ID ${l} added to the keyStatusMap`),this.keyStatusMap_.set(l,o)}updatePlaylistByKeyStatus(t,o){this.addKeyStatus_(t,o),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const PG=(n,t,o)=>a=>{const i=n.main.playlists[t],l=dp(i),s=yc(i);if(typeof a>"u")return s;a?delete i.disabled:i.disabled=!0;const r={renditionInfo:{id:t,bandwidth:i.attributes.BANDWIDTH,resolution:i.attributes.RESOLUTION,codecs:i.attributes.CODECS},cause:"fast-quality"};return a!==s&&!l&&(a?(o(i),n.trigger({type:"renditionenabled",metadata:r})):n.trigger({type:"renditiondisabled",metadata:r})),a};class DG{constructor(t,o,a){const{playlistController_:i}=t,l=i.fastQualityChange_.bind(i);if(o.attributes){const s=o.attributes.RESOLUTION;this.width=s&&s.width,this.height=s&&s.height,this.bandwidth=o.attributes.BANDWIDTH,this.frameRate=o.attributes["FRAME-RATE"]}this.codecs=ws(i.main(),o),this.playlist=o,this.id=a,this.enabled=PG(t.playlists,o.id,l)}}const $G=function(n){n.representations=()=>{const t=n.playlistController_.main(),o=ys(t)?n.playlistController_.getAudioTrackPlaylists_():t.playlists;return o?o.filter(a=>!dp(a)).map((a,i)=>new DG(n,a,a.id)):[]}},W2=["seeking","seeked","pause","playing","error"];class LG extends ie.EventTarget{constructor(t){super(),this.playlistController_=t.playlistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=no("PlaybackWatcher"),this.logger_("initialize");const o=()=>this.monitorCurrentTime_(),a=()=>this.monitorCurrentTime_(),i=()=>this.techWaiting_(),l=()=>this.resetTimeUpdate_(),s=this.playlistController_,r=["main","subtitle","audio"],c={};r.forEach(g=>{c[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},s[`${g}SegmentLoader_`].on("appendsdone",c[g].updateend),s[`${g}SegmentLoader_`].on("playlistupdate",c[g].reset),this.tech_.on(["seeked","seeking"],c[g].reset)});const u=g=>{["main","audio"].forEach(m=>{s[`${m}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",i),this.tech_.on(W2,l),this.tech_.on("canplay",a),this.tech_.one("play",o),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",i),this.tech_.off(W2,l),this.tech_.off("canplay",a),this.tech_.off("play",o),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),r.forEach(g=>{s[`${g}SegmentLoader_`].off("appendsdone",c[g].updateend),s[`${g}SegmentLoader_`].off("playlistupdate",c[g].reset),this.tech_.off(["seeked","seeking"],c[g].reset)}),this.checkCurrentTimeTimeout_&&K.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&K.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=K.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(t){const o=this.playlistController_[`${t}SegmentLoader_`];this[`${t}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${t} loader`),this[`${t}StalledDownloads_`]=0,this[`${t}Buffered_`]=o.buffered_()}checkSegmentDownloads_(t){const o=this.playlistController_,a=o[`${t}SegmentLoader_`],i=a.buffered_(),l=Cq(this[`${t}Buffered_`],i);if(this[`${t}Buffered_`]=i,l){const s={bufferedRanges:i};o.trigger({type:"bufferedrangeschanged",metadata:s}),this.resetSegmentDownloads_(t);return}this[`${t}StalledDownloads_`]++,this.logger_(`found #${this[`${t}StalledDownloads_`]} ${t} appends that did not increase buffer (possible stalled download)`,{playlistId:a.playlist_&&a.playlist_.id,buffered:Ja(i)}),!(this[`${t}StalledDownloads_`]<10)&&(this.logger_(`${t} loader stalled download exclusion`),this.resetSegmentDownloads_(t),this.tech_.trigger({type:"usage",name:`vhs-${t}-download-exclusion`}),t!=="subtitle"&&o.excludePlaylist({error:{message:`Excessive ${t} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const t=this.tech_.currentTime(),o=this.tech_.buffered();if(this.lastRecordedTime===t&&(!o.length||t+Do>=o.end(o.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&t===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(t===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(jt([this.lastRecordedTime,t]));const a={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:a}),this.consecutiveUpdates=0,this.lastRecordedTime=t}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const o=this.seekable(),a=this.tech_.currentTime(),i=this.afterSeekableWindow_(o,a,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let l;if(i&&(l=o.end(o.length-1)),this.beforeSeekableWindow_(o,a)){const f=o.start(0);l=f+(f===o.end(0)?0:Do)}if(typeof l<"u")return this.logger_(`Trying to seek outside of seekable at time ${a} with seekable range ${A0(o)}. Seeking to ${l}.`),this.tech_.setCurrentTime(l),!0;const s=this.playlistController_.sourceUpdater_,r=this.tech_.buffered(),c=s.audioBuffer?s.audioBuffered():null,u=s.videoBuffer?s.videoBuffered():null,g=this.media(),m=g.partTargetDuration?g.partTargetDuration:(g.targetDuration-Po)*2,d=[c,u];for(let f=0;f<d.length;f++){if(!d[f])continue;if(lp(d[f],a)<m)return!1}const p=gc(r,a);return p.length===0?!1:(l=p.start(0)+Do,this.logger_(`Buffered region starts (${p.start(0)}) just beyond seek point (${a}). Seeking to ${l}.`),this.tech_.setCurrentTime(l),!0)}waiting_(){if(this.techWaiting_())return;const t=this.tech_.currentTime(),o=this.tech_.buffered(),a=el(o,t);if(a.length&&t+3<=a.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.logger_(`Stopped at ${t} while inside a buffered region [${a.start(0)} -> ${a.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const t=this.seekable(),o=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(t,o)){const r=t.end(t.length-1);return this.logger_(`Fell out of live window at time ${o}. Seeking to live point (seekable end) ${r}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(r),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const a=this.tech_.vhs.playlistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:o}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const s=gc(i,o);return s.length>0?(this.logger_(`Stopped at ${o} and seeking to ${s.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(o),!0):!1}afterSeekableWindow_(t,o,a,i=!1){if(!t.length)return!1;let l=t.end(t.length-1)+Do;const s=!a.endList,r=typeof a.partTargetDuration=="number";return s&&(r||i)&&(l=t.end(t.length-1)+a.targetDuration*3),o>l}beforeSeekableWindow_(t,o){return!!(t.length&&t.start(0)>0&&o<t.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:t,audioBuffered:o,currentTime:a}){if(!t)return;let i;if(t.length&&o.length){const l=el(t,a-3),s=el(t,a),r=el(o,a);r.length&&!s.length&&l.length&&(i={start:l.end(0),end:r.end(0)})}else gc(t,a).length||(i=this.gapFromVideoUnderflow_(t,a));return i?(this.logger_(`Encountered a gap in video from ${i.start} to ${i.end}. Seeking to current time ${a}`),!0):!1}skipTheGap_(t){const o=this.tech_.buffered(),a=this.tech_.currentTime(),i=gc(o,a);if(this.resetTimeUpdate_(),i.length===0||a!==t)return;this.logger_("skipTheGap_:","currentTime:",a,"scheduled currentTime:",t,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+Po);const l={gapInfo:{from:a,to:i.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:l}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(t,o){const a=_q(t);for(let i=0;i<a.length;i++){const l=a.start(i),s=a.end(i);if(o-l<4&&o-l>2)return{start:l,end:s}}return null}}const AG={errorInterval:30,getSource(n){const o=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return n(o)}},G2=function(n,t){let o=0,a=0;const i=at(AG,t);n.ready(()=>{n.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const l=function(){a&&n.currentTime(a)},s=function(g){g!=null&&(a=n.duration()!==1/0&&n.currentTime()||0,n.one("loadedmetadata",l),n.src(g),n.trigger({type:"usage",name:"vhs-error-reload"}),n.play())},r=function(){if(Date.now()-o<i.errorInterval*1e3){n.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!i.getSource||typeof i.getSource!="function"){ie.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return o=Date.now(),i.getSource.call(n,s)},c=function(){n.off("loadedmetadata",l),n.off("error",r),n.off("dispose",c)},u=function(g){c(),G2(n,g)};n.on("error",r),n.on("dispose",c),n.reloadSourceOnError=u},IG=function(n){G2(this,n)};var X2="3.17.2",vG="7.1.0",MG="1.3.1",OG="7.2.0",UG="4.0.2";const Vt={PlaylistLoader:ol,Playlist:Sn,utils:qq,STANDARD_PLAYLIST_SELECTOR:N2,INITIAL_PLAYLIST_SELECTOR:DW,lastBandwidthSelector:N2,movingAverageBandwidthSelector:BW,comparePlaylistBandwidth:Cp,comparePlaylistResolution:SW,xhr:o2()};Object.keys(zt).forEach(n=>{Object.defineProperty(Vt,n,{get(){return ie.log.warn(`using Vhs.${n} is UNSAFE be sure you know what you are doing`),zt[n]},set(t){if(ie.log.warn(`using Vhs.${n} is UNSAFE be sure you know what you are doing`),typeof t!="number"||t<0){ie.log.warn(`value of Vhs.${n} must be greater than or equal to 0`);return}zt[n]=t}})});const Y2="videojs-vhs",K2=function(n,t){const o=t.media();let a=-1;for(let i=0;i<n.length;i++)if(n[i].id===o.id){a=i;break}n.selectedIndex_=a,n.trigger({selectedIndex:a,type:"change"})},RG=function(n,t){t.representations().forEach(o=>{n.addQualityLevel(o)}),K2(n,t.playlists)};Vt.canPlaySource=function(){return ie.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const FG=(n,t,o)=>{if(!n)return n;let a={};t&&t.attributes&&t.attributes.CODECS&&(a=_s(Vo(t.attributes.CODECS))),o&&o.attributes&&o.attributes.CODECS&&(a.audio=o.attributes.CODECS);const i=ki(a.video),l=ki(a.audio),s={};for(const r in n)s[r]={},l&&(s[r].audioContentType=l),i&&(s[r].videoContentType=i),t.contentProtection&&t.contentProtection[r]&&t.contentProtection[r].pssh&&(s[r].pssh=t.contentProtection[r].pssh),typeof n[r]=="string"&&(s[r].url=n[r]);return at(n,s)},HG=(n,t)=>n.reduce((o,a)=>{if(!a.contentProtection)return o;const i=t.reduce((l,s)=>{const r=a.contentProtection[s];return r&&r.pssh&&(l[s]={pssh:r.pssh}),l},{});return Object.keys(i).length&&o.push(i),o},[]),jG=({player:n,sourceKeySystems:t,audioMedia:o,mainPlaylists:a})=>{if(!n.eme.initializeMediaKeys)return Promise.resolve();const i=o?a.concat([o]):a,l=HG(i,Object.keys(t)),s=[],r=[];return l.forEach(c=>{r.push(new Promise((u,g)=>{n.tech_.one("keysessioncreated",u)})),s.push(new Promise((u,g)=>{n.eme.initializeMediaKeys({keySystems:c},m=>{if(m){g(m);return}u()})}))}),Promise.race([Promise.all(s),Promise.race(r)])},zG=({player:n,sourceKeySystems:t,media:o,audioMedia:a})=>{const i=FG(t,o,a);return i?(n.currentSource().keySystems=i,i&&!n.eme?(ie.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Q2=()=>{if(!K.localStorage)return null;const n=K.localStorage.getItem(Y2);if(!n)return null;try{return JSON.parse(n)}catch{return null}},qG=n=>{if(!K.localStorage)return!1;let t=Q2();t=t?at(t,n):n;try{K.localStorage.setItem(Y2,JSON.stringify(t))}catch{return!1}return t},WG=n=>n.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(n.substring(n.indexOf(",")+1)):n,Z2=(n,t)=>{n._requestCallbackSet||(n._requestCallbackSet=new Set),n._requestCallbackSet.add(t)},J2=(n,t)=>{n._responseCallbackSet||(n._responseCallbackSet=new Set),n._responseCallbackSet.add(t)},ey=(n,t)=>{n._requestCallbackSet&&(n._requestCallbackSet.delete(t),n._requestCallbackSet.size||delete n._requestCallbackSet)},ty=(n,t)=>{n._responseCallbackSet&&(n._responseCallbackSet.delete(t),n._responseCallbackSet.size||delete n._responseCallbackSet)};Vt.supportsNativeHls=function(){if(!ye||!ye.createElement)return!1;const n=ye.createElement("video");return ie.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(o){return/maybe|probably/i.test(n.canPlayType(o))}):!1}(),Vt.supportsNativeDash=function(){return!ye||!ye.createElement||!ie.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ye.createElement("video").canPlayType("application/dash+xml"))}(),Vt.supportsTypeNatively=n=>n==="hls"?Vt.supportsNativeHls:n==="dash"?Vt.supportsNativeDash:!1,Vt.isSupported=function(){return ie.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Vt.xhr.onRequest=function(n){Z2(Vt.xhr,n)},Vt.xhr.onResponse=function(n){J2(Vt.xhr,n)},Vt.xhr.offRequest=function(n){ey(Vt.xhr,n)},Vt.xhr.offResponse=function(n){ty(Vt.xhr,n)};const GG=ie.getComponent("Component");class ny extends GG{constructor(t,o,a){if(super(o,a.vhs),typeof a.initialBandwidth=="number"&&(this.options_.bandwidth=a.initialBandwidth),this.logger_=no("VhsHandler"),o.options_&&o.options_.playerId){const i=ie.getPlayer(o.options_.playerId);this.player_=i}if(this.tech_=o,this.source_=t,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&o.overrideNativeAudioTracks&&o.overrideNativeVideoTracks)o.overrideNativeAudioTracks(!0),o.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(o.featuresNativeVideoTracks||o.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(ye,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],i=>{const l=ye.fullscreenElement||ye.webkitFullscreenElement||ye.mozFullScreenElement||ye.msFullscreenElement;l&&l.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(t={}){if(this.options_=at(this.options_,t),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const a=Q2();a&&a.bandwidth&&(this.options_.bandwidth=a.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),a&&a.throughput&&(this.options_.throughput=a.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=zt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===zt.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(a=>{typeof this.source_[a]<"u"&&(this.options_[a]=this.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const o=this.options_.customPixelRatio;typeof o=="number"&&o>=0&&(this.customPixelRatio=o)}setOptions(t={}){this.setOptions_(t)}src(t,o){if(!t)return;this.setOptions_(),this.options_.src=WG(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Vt,this.options_.sourceType=Df(o),this.options_.seekTo=l=>{this.tech_.setCurrentTime(l)},this.options_.player_=this.player_,this.playlistController_=new BG(this.options_);const a=at({liveRangeSafeTimeDelta:Do},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new LG(a),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const l=ie.players[this.tech_.options_.playerId];let s=this.playlistController_.error;typeof s=="object"&&!s.code?s.code=3:typeof s=="string"&&(s={message:s,code:3}),l.error(s)});const i=this.options_.bufferBasedABR?Vt.movingAverageBandwidthSelector(.55):Vt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):i.bind(this),this.playlistController_.selectInitialPlaylist=Vt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(l){this.playlistController_.selectPlaylist=l.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(l){this.playlistController_.mainSegmentLoader_.throughput.rate=l,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let l=this.playlistController_.mainSegmentLoader_.bandwidth;const s=K.navigator.connection||K.navigator.mozConnection||K.navigator.webkitConnection,r=1e7;if(this.options_.useNetworkInformationApi&&s){const c=s.downlink*1e3*1e3;c>=r&&l>=r?l=Math.max(l,c):l=c}return l},set(l){this.playlistController_.mainSegmentLoader_.bandwidth=l,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const l=1/(this.bandwidth||1);let s;return this.throughput>0?s=1/this.throughput:s=0,Math.floor(1/(l+s))},set(){ie.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ja(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Ja(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&qG({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{$G(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=K.URL.createObjectURL(this.playlistController_.mediaSource),(ie.browser.IS_ANY_SAFARI||ie.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),jG({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(o=>{this.logger_("error while creating EME key session",o),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,o=zG({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});if(this.player_.tech_.on("keystatuschange",a=>{this.playlistController_.updatePlaylistByKeyStatus(a.keyId,a.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!o){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const t=ie.players[this.tech_.options_.playerId];!t||!t.qualityLevels||this.qualityLevels_||(this.qualityLevels_=t.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{RG(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{K2(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":X2,"mux.js":vG,"mpd-parser":MG,"m3u8-parser":OG,"aes-decrypter":UG}}version(){return this.constructor.version()}canChangeType(){return v2.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(t){this.playlistController_.setCurrentTime(t)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&K.URL.revokeObjectURL&&(K.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(t,o){return Zq({playlist:this.playlistController_.media(),time:t,callback:o})}seekToProgramTime(t,o,a=!0,i=2){return r2({programTime:t,playlist:this.playlistController_.media(),retryCount:i,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:o})}setupXhrHooks_(){this.xhr.onRequest=t=>{Z2(this.xhr,t)},this.xhr.onResponse=t=>{J2(this.xhr,t)},this.xhr.offRequest=t=>{ey(this.xhr,t)},this.xhr.offResponse=t=>{ty(this.xhr,t)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const t=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],o=["gapjumped","playedrangeschanged"];t.forEach(a=>{this.playlistController_.on(a,i=>{this.player_.trigger(Et({},i))})}),o.forEach(a=>{this.playbackWatcher_.on(a,i=>{this.player_.trigger(Et({},i))})})}}const Vc={name:"videojs-http-streaming",VERSION:X2,canHandleSource(n,t={}){const o=at(ie.options,t);return!o.vhs.experimentalUseMMS&&!Hl("avc1.4d400d,mp4a.40.2",!1)?!1:Vc.canPlayType(n.type,o)},handleSource(n,t,o={}){const a=at(ie.options,o);return t.vhs=new ny(n,t,a),t.vhs.xhr=o2(),t.vhs.setupXhrHooks_(),t.vhs.src(n.src,n.type),t.vhs},canPlayType(n,t){const o=Df(n);if(!o)return"";const a=Vc.getOverrideNative(t);return!Vt.supportsTypeNatively(o)||a?"maybe":""},getOverrideNative(n={}){const{vhs:t={}}=n,o=!(ie.browser.IS_ANY_SAFARI||ie.browser.IS_IOS),{overrideNative:a=o}=t;return a}};Hl("avc1.4d400d,mp4a.40.2",!0)&&ie.getTech("Html5").registerSourceHandler(Vc,0),ie.VhsHandler=ny,ie.VhsSourceHandler=Vc,ie.Vhs=Vt,ie.use||ie.registerComponent("Vhs",Vt),ie.options.vhs=ie.options.vhs||{},(!ie.getPlugin||!ie.getPlugin("reloadSourceOnError"))&&ie.registerPlugin("reloadSourceOnError",IG);const XG={name:"MediaVideoPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""}},data(){return{player:null}},mounted(){this.player=ie(this.$refs.videoPlayer,{autoplay:!1,controls:!0,muted:!0,fluid:!0,sources:[{src:this.url,type:"video/mp4"}],poster:this.poster})},beforeDestroy(){this.player&&this.player.dispose()}},YG={ref:"videoPlayer",class:"video-js"};function KG(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("video",YG,null,512)}const QG=ee(XG,[["render",KG],["__scopeId","data-v-3e044975"]]),ZG={name:"YoutubePlayer",props:{url:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},control:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,player:null}},watch:{isPlaying(){this.resetVideo()}},methods:{resetVideo(){this.player=null,this.isRender=!1,this.$nextTick(()=>{this.isRender=!0,this.$nextTick(()=>{setTimeout(this.initPlayer,300)})})},initPlayer(){if(!YT||!document.getElementById(`yt-player-${this.timestamp}`)){setTimeout(this.initPlayer,3e3);return}this.player||(this.player=new YT.Player(`yt-player-${this.timestamp}`,{origin:"http://localhost:3000/",events:{onStateChange:this.onPlayerStateChange}}))},onPlayerStateChange(){this.player.getPlayerState()==0&&this.$emit("playEnd")}},mounted(){this.$nextTick(()=>{setTimeout(this.initPlayer,300)})}},JG={class:"youtube-player"},eX=["id","src"];function tX(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("div",JG,[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["video-foreground",{"show-control-n-fit":o.control}])},[e.createElementVNode("iframe",{id:`yt-player-${i.timestamp}`,ref:"player",width:"1280",height:"537",src:`${o.url}?enablejsapi=1&controls=${o.control?1:0}&autoplay=${o.autoplay||o.isPlaying}&mute=${o.mute?1:0}`,title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",sandbox:"allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation"},null,8,eX)],2)):e.createCommentVNode("",!0)])}const nX=ee(ZG,[["render",tX],["__scopeId","data-v-ca2b2fbb"]]),oX={name:"BilibiliPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,wrapperRatio:1}},computed:{isVideoWider(){return this.wrapperRatio>1}},watch:{isPlaying(n,t){this.resetVideo()}},methods:{resetVideo(){this.isRender=!1,this.$nextTick(()=>{this.isRender=!0})}},mounted(){this.$nextTick(()=>{this.wrapperRatio=this.$refs.wrapper.clientWidth/this.$refs.wrapper.clientHeight})}},aX={class:"bilibili-player",ref:"wrapper"},iX=["id","src"];function lX(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("div",aX,[e.createElementVNode("div",{class:e.normalizeClass(["video-foreground",[{"video-foreground--wider":l.isVideoWider,"video-foreground--higher":!l.isVideoWider}]])},[i.isRender?(e.openBlock(),e.createElementBlock("iframe",{key:0,id:`bilibili-player-${i.timestamp}`,scrolling:"no",border:"0",frameborder:"no",framespacing:"0",allowfullscreen:"true",src:`${o.url}&high_quality=1&danmaku=0&as_wide=1`},null,8,iX)):e.createCommentVNode("",!0)],2)],512)}const sX=ee(oX,[["render",lX],["__scopeId","data-v-40e15401"]]),rX={name:"YoukuPlayer",props:{url:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0}},methods:{resetVideo(){this.isRender=!1,this.$nextTick(()=>{this.isRender=!0})}}},dX={class:"youku-player"},cX=["src","id"];function uX(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("div",dX,[e.createElementVNode("iframe",{width:"1280",height:"537",src:`${o.url}?rel=0&autoplay=${o.isPlaying}`,frameborder:"0",allowfullscreen:"",id:`youku-player-${i.timestamp}`,sandbox:"allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation"},null,8,cX)])}const mX=ee(rX,[["render",uX],["__scopeId","data-v-cf32c3a0"]]),pX={name:"QqPlayer",props:{url:{type:String,default:()=>""},poster:{type:String,default:()=>""},isPlaying:{type:Boolean,default:()=>!1},mute:{type:Boolean,default:()=>!1},autoplay:{type:Boolean,default:()=>!1}},data(){return{timestamp:Date.now(),isRender:!0,player:null,wrapperRatio:1}},computed:{isVideoWider(){return this.wrapperRatio>1}},watch:{isPlaying(){this.resetVideo()}},methods:{resetVideo(){this.player=null,this.isRender=!1,this.$nextTick(()=>{this.isRender=!0,this.$nextTick(()=>{setTimeout(this.initPlayer,300)})})},initPlayer(){const n=document.getElementById(`qq-player-${this.timestamp}`);if(!Txp||!n){setTimeout(this.initPlayer,3e3);return}if(this.player)return;this.player=new Txp.Player({containerId:`qq-player-${this.timestamp}`,vid:this.url,width:"100%",height:"100%",autoplay:this.autoplay||this.$_vsWidth>=768||this.isPlaying,mini:!0,muted:this.mute,volume:this.mute?0:50});const t=n.querySelector("iframe");t.sandbox="allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation",this.player.on("playStateChange",this.onPlayerStateChange)},onPlayerStateChange(n){n.state==0&&this.$emit("playEnd")}},mounted(){this.$nextTick(()=>{this.wrapperRatio=this.$refs.wrapper.clientWidth/this.$refs.wrapper.clientHeight,setTimeout(this.initPlayer,300)})}},hX={class:"qq-player",ref:"wrapper"},fX=["id"],gX={class:"qq-player__poster"},yX=["src"];function _X(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("div",hX,[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["video-foreground",[{"video-foreground--wider":l.isVideoWider,"video-foreground--higher":!l.isVideoWider}]])},[i.isRender?(e.openBlock(),e.createElementBlock("div",{key:0,class:"iframe",id:`qq-player-${i.timestamp}`},null,8,fX)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",gX,[e.createElementVNode("img",{src:o.poster,alt:"poster"},null,8,yX)],512),[[e.vShow,!o.isPlaying&&!o.autoplay]])],512)}const wX=ee(pX,[["render",_X],["__scopeId","data-v-719611b1"]]),bX={name:"FbPlayer",props:{html:{type:String,default:()=>""}},mounted(){this.loadFacebookSDK()},methods:{loadFacebookSDK(){if(document.querySelector('script[src*="connect.facebook.net"]'))return;const n=document.createElement("script");n.async=!0,n.defer=!0,n.crossOrigin="anonymous",n.src="https://connect.facebook.net/zh_TW/sdk.js#xfbml=1&version=v14.0",n.nonce="5tyirFAy",document.body.appendChild(n)}}},CX={class:"fb-player",ref:"wrapper"},VX=["innerHTML"];function xX(n,t,o,a,i,l){return e.openBlock(),e.createElementBlock("div",CX,[t[0]||(t[0]=e.createElementVNode("div",{id:"fb-root"},null,-1)),e.createElementVNode("div",{innerHTML:o.html},null,8,VX)],512)}const kX=ee(bX,[["render",xX],["__scopeId","data-v-c5a2a3ed"]]),EX={class:"media_video_wrap"},TX={class:"img-wrapper"},NX={key:0},SX={key:1},BX={key:2},PX={key:3},DX={key:4},$X={key:5},xc=ee(e.defineComponent({name:"MediaVideo",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const o=n,a=t,i=e.ref(!1),l=()=>{var f;if(o.modelValue&&o.modelValue.data)return;const p={id:((f=o.modelValue)==null?void 0:f.id)||F(),type:"MediaVideo",onlyShowPc:!1,data:{width:"中",type:"inner",videoSrc:"https://mvideo.ycyw.com/2e1a9441vodgzp1253458132/a31402d51397757891052265568/SW8B19vOtzMA.mp4",videoThumbnail:"https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg"}};a("update:modelValue",p)},s=e.computed(()=>{var p;return o.isPreview?!((p=o.modelValue)!=null&&p.onlyShowPc)||!Ne():!0}),r=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var h,V;const p=(V=(h=o.modelValue)==null?void 0:h.data)==null?void 0:V.width;return!p||p==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[p]||"container-content"}),g=()=>{a("handleDelete",o.modelValue.id)},m=()=>{a("handleCopy",o.modelValue)},d=p=>{a("handlePaste",p)};return l(),(p,f)=>{var h,V,w,k,y,b,C,E,x,N,$,S;return e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mediaVideo_wrap_box",onMouseenter:f[2]||(f[2]=I=>r.value=!0),onMouseleave:f[3]||(f[3]=I=>r.value=!1)},[e.createElementVNode("div",EX,[e.createElementVNode("div",{class:e.normalizeClass(["media-video__container",u.value])},[e.createElementVNode("div",TX,[((V=(h=n.modelValue)==null?void 0:h.data)==null?void 0:V.type)==="inner"?(e.openBlock(),e.createElementBlock("div",NX,[e.createVNode(QG,{url:n.modelValue.data.videoSrc,poster:n.modelValue.data.videoThumbnail},null,8,["url","poster"])])):e.createCommentVNode("",!0),((k=(w=n.modelValue)==null?void 0:w.data)==null?void 0:k.type)==="youtube"?(e.openBlock(),e.createElementBlock("div",SX,[e.createVNode(nX,{url:n.modelValue.data.videoSrc,isPlaying:i.value,control:!0,autoplay:i.value},null,8,["url","isPlaying","autoplay"])])):e.createCommentVNode("",!0),((b=(y=n.modelValue)==null?void 0:y.data)==null?void 0:b.type)==="bilibili"?(e.openBlock(),e.createElementBlock("div",BX,[e.createVNode(sX,{url:n.modelValue.data.videoSrc,isPlaying:i.value},null,8,["url","isPlaying"])])):e.createCommentVNode("",!0),((E=(C=n.modelValue)==null?void 0:C.data)==null?void 0:E.type)==="youku"?(e.openBlock(),e.createElementBlock("div",PX,[e.createVNode(mX,{url:n.modelValue.data.videoSrc,isPlaying:i.value},null,8,["url","isPlaying"])])):e.createCommentVNode("",!0),((N=(x=n.modelValue)==null?void 0:x.data)==null?void 0:N.type)==="qq"?(e.openBlock(),e.createElementBlock("div",DX,[e.createVNode(wX,{url:n.modelValue.data.videoSrc,isPlaying:i.value,autoplay:i.value},null,8,["url","isPlaying","autoplay"])])):e.createCommentVNode("",!0),((S=($=n.modelValue)==null?void 0:$.data)==null?void 0:S.type)==="facebook"?(e.openBlock(),e.createElementBlock("div",$X,[e.createVNode(kX,{html:n.modelValue.data.videoSrc},null,8,["html"])])):e.createCommentVNode("",!0)])],2)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:r.value,"onUpdate:show":f[0]||(f[0]=I=>r.value=I),onHandleEdit:f[1]||(f[1]=I=>c.value=!0),onHandleDelete:g,onHandleCopy:m,onHandlePaste:d},null,8,["show"]))],32)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(qR,{key:1,show:c.value,"onUpdate:show":f[4]||(f[4]=I=>c.value=I),data:n.modelValue},null,8,["show","data"]))],64)}}}),[["__scopeId","data-v-f642da26"]]),LX=Object.freeze(Object.defineProperty({__proto__:null,default:xc},Symbol.toStringTag,{value:"Module"})),AX={class:"setting-content"},IX={class:"setting-header flex items-center"},vX=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){e.defineAsyncComponent(()=>Promise.resolve().then(()=>_t));const o=t,a=()=>{o("update:show",!1)};return(i,l)=>{const s=e.resolveComponent("a-switch"),r=e.resolveComponent("a-option"),c=e.resolveComponent("a-select"),u=e.resolveComponent("a-input"),g=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(g,{width:500,visible:n.show,footer:!1,onCancel:a,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",AX,[e.createElementVNode("div",IX,[l[4]||(l[4]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(s,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":l[0]||(l[0]=m=>n.data.onlyShowPc=m)},null,8,["modelValue"])]),l[9]||(l[9]=e.createElementVNode("p",{class:"item-title"},"组件宽度",-1)),e.createVNode(c,{modelValue:n.data.data.width,"onUpdate:modelValue":l[1]||(l[1]=m=>n.data.data.width=m),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode(r,{value:""},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createTextVNode("默认",-1)])]),_:1}),e.createVNode(r,{value:"small"},{default:e.withCtx(()=>[...l[6]||(l[6]=[e.createTextVNode("小",-1)])]),_:1}),e.createVNode(r,{value:"middle"},{default:e.withCtx(()=>[...l[7]||(l[7]=[e.createTextVNode("中",-1)])]),_:1}),e.createVNode(r,{value:"max"},{default:e.withCtx(()=>[...l[8]||(l[8]=[e.createTextVNode("大",-1)])]),_:1})]),_:1},8,["modelValue"]),l[10]||(l[10]=e.createElementVNode("p",{class:"item-title"},"标题",-1)),e.createVNode(u,{modelValue:n.data.data.title,"onUpdate:modelValue":l[2]||(l[2]=m=>n.data.data.title=m),placeholder:"请输入标题","allow-clear":""},null,8,["modelValue"]),l[11]||(l[11]=e.createElementVNode("p",{class:"item-title"},"链接",-1)),e.createVNode(u,{modelValue:n.data.data.link,"onUpdate:modelValue":l[3]||(l[3]=m=>n.data.data.link=m),placeholder:"请输入链接","allow-clear":""},null,8,["modelValue"])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-ba14f699"]]),MX={class:"information-link__wrapper"},OX={key:0},UX=["innerHTML"],RX={key:1,class:"information-link__btn btn p-0",type:"button"},FX=["innerHTML"],kc=ee(e.defineComponent({name:"InformationLink",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,a=t,i=p=>{a("handleClick",p)},l=e.computed(()=>{var p;return o.isPreview?!((p=o.modelValue)!=null&&p.onlyShowPc)||!Ne():!0}),s=()=>{var f;if(o.modelValue&&o.modelValue.data)return;const p={id:((f=o.modelValue)==null?void 0:f.id)||F(),type:"InformationLink",onlyShowPc:!1,data:{width:"中",title:"这里是标题",link:"https://www.baidu.com"}};a("update:modelValue",p)},r=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var h,V;const p=(V=(h=o.modelValue)==null?void 0:h.data)==null?void 0:V.width;return!p||p==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[p]||"container-content"}),g=()=>{a("handleDelete",o.modelValue.id)},m=()=>{a("handleCopy",o.modelValue)},d=p=>{a("handlePaste",p)};return s(),(p,f)=>{var h,V,w,k,y,b,C,E;return e.openBlock(),e.createElementBlock(e.Fragment,null,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"informationLink_wrap",onMouseenter:f[3]||(f[3]=x=>r.value=!0),onMouseleave:f[4]||(f[4]=x=>r.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["media-image-full",u.value])},[e.createElementVNode("div",MX,[(V=(h=n.modelValue)==null?void 0:h.data)!=null&&V.link?(e.openBlock(),e.createElementBlock("div",OX,[(k=(w=n.modelValue)==null?void 0:w.data)!=null&&k.link?(e.openBlock(),e.createElementBlock("div",{key:0,target:"_blank",class:"information-link__btn btn p-0",onClick:f[0]||(f[0]=x=>{var N,$;return i(($=(N=n.modelValue)==null?void 0:N.data)==null?void 0:$.link)})},[e.createElementVNode("h6",{class:"information-link__title",innerHTML:(b=(y=n.modelValue)==null?void 0:y.data)==null?void 0:b.title},null,8,UX),f[6]||(f[6]=e.createElementVNode("div",{class:"i i-arrow-next"},null,-1))])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",RX,[e.createElementVNode("h6",{class:"information-link__title",innerHTML:(E=(C=n.modelValue)==null?void 0:C.data)==null?void 0:E.title},null,8,FX),f[7]||(f[7]=e.createElementVNode("div",{class:"i i-arrow-next"},null,-1))]))])],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:r.value,"onUpdate:show":f[1]||(f[1]=x=>r.value=x),onHandleEdit:f[2]||(f[2]=x=>c.value=!0),onHandleDelete:g,onHandleCopy:m,onHandlePaste:d},null,8,["show"]))],32)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(vX,{key:1,show:c.value,"onUpdate:show":f[5]||(f[5]=x=>c.value=x),data:n.modelValue},null,8,["show","data"]))],64)}}}),[["__scopeId","data-v-4f7843cf"]]),HX=Object.freeze(Object.defineProperty({__proto__:null,default:kc},Symbol.toStringTag,{value:"Module"})),jX={key:0,class:"tab-primary__btn__img flex-center"},zX=["src","alt"],qX={key:1},WX=ee({__name:"TabPrimary",props:{tabList:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:()=>0},isFixed:{type:Boolean,default:()=>!1},fullWidth:{type:Boolean,default:()=>!1},isPreview:{type:Boolean,default:!0}},emits:["updateCurrentIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:l,$vsScreenDestroyListener:s}=o,r=n,c=t,u=e.ref(null),g=e.ref(null),m=e.ref([]),d=e.ref(0),p=e.ref(.5*a.value),f=e.ref(0),h=e.ref(!0),V=e.ref(!0),w=e.ref(0),k=e.ref(!1),y=e.ref(0),b=e.ref(0),C=e.ref(0);e.ref(0);const E=e.ref(null),x=e.ref(null),N=e.ref(null),$=e.ref(null),S=e.ref(null),I=e.computed(()=>d.value-p.value),D=e.computed(()=>[{"--strip-width":`${I.value}px`},{"--strip-left":`${p.value}px`},{"--fix-left":`${f.value}px`},{transition:V.value?"left 0.2s ease-in-out, width 0.2s ease-in-out":""}]),A=e.computed(()=>y.value>0),O=e.computed(()=>b.value-y.value+Q.value>C.value),Q=e.computed(()=>{if(!k.value)return 24;const _e=u.value;return _e?window.getComputedStyle(_e,null).getPropertyValue("padding-right").split("px")[0]*2:24}),X=e.computed(()=>!1);e.watch(a,()=>{U(),R()}),e.watch(()=>r.currentIdx,(_e,le)=>{h.value=_e>le,e.nextTick(G),e.nextTick(J)}),e.watch(()=>r.tabList,(_e,le)=>{R(),e.nextTick(()=>{G(0)})},{deep:!0}),e.watch(()=>r.isFixed,()=>{a.value>1200&&U(),e.nextTick(R)});const G=_e=>{const le=_e??250;h.value?(M(),$.value=setTimeout(q,le)):(q(),$.value=setTimeout(M,le)),S.value=setTimeout(()=>{V.value=!0},le)},M=()=>{const _e=m.value;let le=null;_e&&_e[r.currentIdx]&&(le=_e[r.currentIdx]),le&&le.getBoundingClientRect&&(d.value=le.getBoundingClientRect().right)},q=()=>{const _e=m.value;let le=null;_e&&_e[r.currentIdx]&&(le=_e[r.currentIdx]),le&&le.getBoundingClientRect&&(p.value=le.getBoundingClientRect().left)},U=()=>{V.value=!1,e.nextTick(()=>G(0)),e.nextTick(H)},R=()=>{const _e=u.value;if(_e){let le=_e.getBoundingClientRect().left;f.value=(_e.offsetWidth-_e.getBoundingClientRect().width)/2+le}},H=()=>{var pe;if(!((pe=r.tabList)!=null&&pe.length))return;const _e=g.value;_e&&(y.value=_e.scrollLeft,b.value=_e.scrollWidth);const le=u.value;le&&(C.value=le.getBoundingClientRect().width)},j=_e=>{g.value&&(_e=="next"?g.value.scrollLeft+=9999:g.value.scrollLeft-=9999)},J=()=>{const _e=m.value[r.currentIdx];if(!_e)return;const le=_e.clientWidth/2,pe=a.value/2;w.value=_e.getBoundingClientRect().right-le,g.value&&(g.value.scrollLeft-=pe-w.value)},fe=(_e,le)=>{_e&&r.isPreview||c("updateCurrentIdx",le)},xe=_e=>_e&&r.isPreview?_e.includes("http")?"a":"RouterLink":"button",ne=_e=>_e&&!_e.includes("http")?_e:null,he=_e=>_e&&_e.includes("http")?_e:null,Ae=_e=>_e&&_e.includes("http")?"_blank":null;return e.onMounted(()=>{k.value=!0,e.nextTick(()=>{G(0),E.value=setTimeout(U,300),R(),e.nextTick(()=>{x.value=setTimeout(J,300)})})}),e.onBeforeUnmount(()=>{clearTimeout(E.value),clearTimeout(x.value),clearTimeout(N.value),clearTimeout($.value),clearTimeout(S.value),window.removeEventListener("resize",()=>{a.value=window.innerWidth})}),(_e,le)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-primary",[{"is-fixed":n.isFixed},{"is-campus":!X.value},{"is-full-width":n.fullWidth}]]),ref_key:"wrapper",ref:u},[e.createElementVNode("ul",{class:"tab-primary__list",ref_key:"list",ref:g,onScroll:U},[e.withDirectives(e.createElementVNode("div",{class:"tab-primary__nav__prev",onClick:le[0]||(le[0]=pe=>j("prev"))},null,512),[[e.vShow,A.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabList,(pe,se)=>(e.openBlock(),e.createElementBlock("li",{key:se,class:e.normalizeClass(["tab-primary__item",[{"is-img":!!pe.img}]])},[e.createElementVNode("div",{ref_for:!0,ref_key:"btnRefs",ref:m,class:"flex-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(xe(pe.link)),{type:pe.link?null:"button",to:ne(pe.link),href:he(pe.link),target:Ae(pe.link),class:e.normalizeClass(["tab-primary__btn",[{"is-active":n.currentIdx==se}]]),onClick:ge=>fe(pe.link,se)},{default:e.withCtx(()=>[pe.img?(e.openBlock(),e.createElementBlock("div",jX,[e.createElementVNode("img",{src:pe.img,alt:pe.alt||pe.name},null,8,zX)])):(e.openBlock(),e.createElementBlock("div",qX,e.toDisplayString(pe.name),1))]),_:2},1032,["type","to","href","target","class","onClick"]))],512)],2))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-primary__nav__next",onClick:le[1]||(le[1]=pe=>j("next"))},null,512),[[e.vShow,O.value]])],544),e.createElementVNode("span",{class:"tab-primary__strip",style:e.normalizeStyle(D.value)},null,4)],2))}},[["__scopeId","data-v-5a75190e"]]),GX={class:"setting-content"},XX={class:"setting-header flex items-center"},YX={class:"setting-body"},KX={class:"setting-toolbar"},QX={class:"tools"},ZX={class:"setting-item"},JX={class:"item-header"},eY={class:"btn-group"},tY={key:0,class:"drag-handle"},nY={class:"components-content"},oY={class:"setting-body"},aY={class:"setting-toolbar"},iY={class:"tools"},lY={class:"setting-item"},sY={class:"item-header"},rY={class:"btn-group"},dY={key:0,class:"drag-handle"},cY={class:"components-content"},uY=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),l=e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=d=>d&&d.length>1,r=n,c=t,u=()=>{c("update:show",!1)},g=d=>{var f;debugger;const p=r.data;d==="listAbove"?p.listAbove.push({id:F(),key:F(),name:"New Tab",componentsDataJson:[{id:((f=r.modelValue)==null?void 0:f.id)||F(),type:"BannerImage",onlyShowPc:!1,data:{title:"这里是标题",imgSrc:"https://osswebsite-test.cedim.cn/ywies-tx/static-images/about-ywies/01_About_YWIES_1_Header.jpg"}}]}):p.data.push({id:F(),key:F(),name:"New Tab",link:"",componentsDataJson:[]})},m=(d,p)=>{p==="listAbove"?r.data.listAbove=r.data.listAbove.filter(f=>f.id!==d):r.data.data=r.data.data.filter(f=>f.id!==d)};return(d,p)=>{const f=e.resolveComponent("a-switch"),h=e.resolveComponent("icon-plus"),V=e.resolveComponent("a-button"),w=e.resolveComponent("icon-drag-arrow"),k=e.resolveComponent("icon-delete"),y=e.resolveComponent("a-input"),b=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(b,{width:"60%",visible:n.show,footer:!1,onCancel:u,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",GX,[e.createElementVNode("div",XX,[p[13]||(p[13]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(f,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":p[0]||(p[0]=C=>n.data.onlyShowPc=C)},null,8,["modelValue"])]),e.createElementVNode("div",YX,[e.createElementVNode("div",KX,[p[16]||(p[16]=e.createElementVNode("h1",null,"List Above",-1)),e.createElementVNode("div",QX,[e.createVNode(V,{type:"primary",onClick:p[1]||(p[1]=C=>g("listAbove"))},{icon:e.withCtx(()=>[e.createVNode(h)]),default:e.withCtx(()=>[p[14]||(p[14]=e.createTextVNode(" 添加 List Above ",-1))]),_:1}),e.createVNode(V,{type:"primary",onClick:p[2]||(p[2]=C=>g("listAbove"))},{default:e.withCtx(()=>[...p[15]||(p[15]=[e.createTextVNode("粘贴 Tab",-1)])]),_:1})])]),e.createElementVNode("div",ZX,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.listAbove,"onUpdate:modelValue":p[4]||(p[4]=C=>n.data.listAbove=C),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},l.value,{disabled:!s(n.data.data),onStart:p[5]||(p[5]=C=>a.value=!0),onEnd:p[6]||(p[6]=C=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:C})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!s(n.data.data)}]),key:C.id},[e.createElementVNode("div",JX,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(C.name),1),e.createElementVNode("span",null,e.toDisplayString(C.key),1)]),e.createElementVNode("div",eY,[s(n.data.data)?(e.openBlock(),e.createElementBlock("div",tY,[e.createVNode(w,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(k,{class:"btn-delete",onClick:E=>m(C.id,"listAbove")},null,8,["onClick"]),e.createVNode(V,{size:"mini",type:"primary",onClick:p[3]||(p[3]=E=>g("Video"))},{default:e.withCtx(()=>[...p[17]||(p[17]=[e.createTextVNode("复制 Tab",-1)])]),_:1})])]),p[18]||(p[18]=e.createElementVNode("p",{class:"item-title"},"Tab名称",-1)),e.createVNode(y,{modelValue:C.name,"onUpdate:modelValue":E=>C.name=E,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[19]||(p[19]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(y,{modelValue:C.key,"onUpdate:modelValue":E=>C.key=E,placeholder:"请输入key","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[20]||(p[20]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",nY,[e.createVNode(Fa,{data:C.componentsDataJson,onUpdate:E=>C.componentsDataJson=E},null,8,["data","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])]),e.createElementVNode("div",oY,[e.createElementVNode("div",aY,[p[23]||(p[23]=e.createElementVNode("h1",null,"List",-1)),e.createElementVNode("div",iY,[e.createVNode(V,{type:"primary",onClick:p[7]||(p[7]=C=>g("Video"))},{icon:e.withCtx(()=>[e.createVNode(h)]),default:e.withCtx(()=>[p[21]||(p[21]=e.createTextVNode(" 添加 List ",-1))]),_:1}),e.createVNode(V,{type:"primary",onClick:p[8]||(p[8]=C=>g("Video"))},{default:e.withCtx(()=>[...p[22]||(p[22]=[e.createTextVNode("粘贴 Tab",-1)])]),_:1})])]),e.createElementVNode("div",lY,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":p[10]||(p[10]=C=>n.data.data=C),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!s(n.data.data),onStart:p[11]||(p[11]=C=>a.value=!0),onEnd:p[12]||(p[12]=C=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:C})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!s(n.data.data)}]),key:C.id},[e.createElementVNode("div",sY,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(C.name),1),e.createElementVNode("span",null,e.toDisplayString(C.key),1)]),e.createElementVNode("div",rY,[s(n.data.data)?(e.openBlock(),e.createElementBlock("div",dY,[e.createVNode(w,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(k,{class:"btn-delete",onClick:E=>m(C.id,"list")},null,8,["onClick"]),e.createVNode(V,{size:"mini",type:"primary",onClick:p[9]||(p[9]=E=>g("Video"))},{default:e.withCtx(()=>[...p[24]||(p[24]=[e.createTextVNode("复制 Tab",-1)])]),_:1})])]),p[25]||(p[25]=e.createElementVNode("p",{class:"item-title"},"Tab名称",-1)),e.createVNode(y,{modelValue:C.name,"onUpdate:modelValue":E=>C.name=E,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[26]||(p[26]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(y,{modelValue:C.key,"onUpdate:modelValue":E=>C.key=E,placeholder:"请输入key","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[27]||(p[27]=e.createElementVNode("p",{class:"item-title"},"Link",-1)),e.createVNode(y,{modelValue:C.link,"onUpdate:modelValue":E=>C.link=E,placeholder:"请输入link","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[28]||(p[28]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",cY,[e.createVNode(Fa,{data:C.componentsDataJson,onUpdate:E=>C.componentsDataJson=E},null,8,["data","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-63c63489"]]),mY={class:"tab-page__above"},pY={key:0},hY={key:0},fY={class:"tab-page__content"},gY={key:0},yY="",Ec=ee({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:""}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=t,{proxy:a}=e.getCurrentInstance(),{$_vsWidth:i,$_vsScrollY:l,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=a,c=n,u=e.ref(0),g=e.ref(!1),m=e.ref(!0),d=e.ref(null),p=e.ref(null),f=e.ref(!1),h=e.ref(!1),V=H=>{if(!H)return{top:0,left:0};const j=H.getBoundingClientRect(),J=window.pageYOffset||document.documentElement.scrollTop,fe=window.pageXOffset||document.documentElement.scrollLeft;return{top:j.top+J,left:j.left+fe}},w=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.classes)??null}),k=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.style)??null});e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.type)??"TabPrimary"});const y=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.listAbove)??[]}),b=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.data)??[]}),C=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.fixed)??!0}),E=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.resetToTop)??!0}),x=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.scrollToTop)??!0}),N=e.computed(()=>{var H;return((H=c.modelValue)==null?void 0:H.fullWidth)??!1});e.computed(()=>0),e.computed(()=>!1);const $=e.computed(()=>b.value.some(H=>H.img)),S=e.computed(()=>{var H;return((H=b.value[u.value])==null?void 0:H.key)??null}),I=e.computed(()=>{var j;if(!((j=c.modelValue)!=null&&j.data)||!Array.isArray(c.modelValue.data))return[];const H=c.modelValue.data[u.value];return H?H.componentsDataJson||[]:[]}),D=e.ref(""),A=()=>{var j,J;if(c.modelValue&&c.modelValue.data){const fe=window==null?void 0:window.location.pathname.split("#")[0].split("/");D.value=((j=window==null?void 0:window.location.pathname.split("#"))==null?void 0:j[1])||"",D.value&&setTimeout(()=>{X()},1e3);const xe=fe[fe.length-1];u.value=b.value.findIndex(ne=>ne.key===xe)||0;return}const H={id:((J=c.modelValue)==null?void 0:J.id)||F(),type:"TabPage",onlyShowPc:!1,containerWidth:"",bgColor:"",classes:"custom-class another-class",style:{},width:"",listAbove:[],data:[{id:F(),key:F(),name:"New Tab1",componentsDataJson:[]},{id:F(),key:F(),name:"New Tab2",componentsDataJson:[]}]};o("update:modelValue",H),u.value=0},O=()=>{var ne,he;const H=p.value;if(!H)return;const j=H.getBoundingClientRect().top,J=d.value;if(!J)return;const fe=J.getBoundingClientRect().top,xe=+((he=(ne=window.getComputedStyle(document.body))==null?void 0:ne.getPropertyValue("--header-height-calc"))==null?void 0:he.split("px")[0])||0;if(fe>xe){g.value=!1;return}j<=xe&&(g.value=!0)},Q=()=>{if(!x.value)return;let H=0;E.value||(H=V(d.value).top-170),window.scroll({top:H,left:0,behavior:"smooth"})},X=()=>{if(!D.value)return;const H=document.querySelector(D.value);if(!H)return;const j=V(H).top;window.scroll({top:j-170,left:0,behavior:"smooth"})},G=H=>{sessionStorage.setItem(yY,H)},M=(H,j)=>{debugger;o("handleDelete",H||c.modelValue.id,j)},q=H=>{debugger;o("handleCopy",H||c.modelValue)},U=(H,j,J)=>{debugger;o("handlePaste",H,j,J)},R=H=>{o("handleClick",H)};return e.watch(()=>l.value,()=>{O()}),e.watch(u,()=>{G(S.value),m.value&&Q(),m.value=!0}),e.watch(S,H=>{H||(u.value=0)}),e.onMounted(()=>{A(),e.nextTick(O),setTimeout(()=>{e.nextTick(O)},200),setTimeout(()=>{},1e3)}),(H,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-page",w.value]),style:e.normalizeStyle(k.value),onMouseover:j[8]||(j[8]=J=>h.value=!0),onMouseout:j[9]||(j[9]=J=>h.value=!1)},[e.createElementVNode("div",mY,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[S.value?(e.openBlock(),e.createElementBlock("div",pY,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(J,fe)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:J.key},[S.value==J.key?(e.openBlock(),e.createElementBlock("div",hY,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.componentsDataJson,(xe,ne)=>(e.openBlock(),e.createBlock(Co,{key:xe.id,hash:xe.hash,type:xe.type,"props-data":{modelValue:xe,isPreview:n.isPreview,host:n.host,locale:n.locale},onHandleDelete:j[0]||(j[0]=he=>M(he,I.value)),onHandleCopy:j[1]||(j[1]=he=>q(he)),onHandlePaste:he=>U(he,I.value,ne),onHandleClick:R},null,8,["hash","type","props-data","onHandlePaste"]))),128))])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["tab-page__hold",[{"is-fixed":g.value&&C.value},{"is-thick":$.value}]]),ref_key:"hold",ref:d},[e.createElementVNode("div",{class:"tab-page__nav",ref_key:"tab",ref:p},[e.createVNode(WX,{tabList:b.value,currentIdx:u.value,isFixed:g.value&&C.value,fullWidth:N.value,isPreview:n.isPreview,onUpdateCurrentIdx:j[2]||(j[2]=J=>u.value=J)},null,8,["tabList","currentIdx","isFixed","fullWidth","isPreview"])],512)],2),e.createElementVNode("div",fY,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[S.value?(e.openBlock(),e.createElementBlock("div",{key:S.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,J=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[S.value==J.key?(e.openBlock(),e.createElementBlock("div",gY,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.componentsDataJson,(fe,xe)=>(e.openBlock(),e.createBlock(Co,{key:fe.id,type:fe.type,"props-data":{modelValue:fe,isPreview:n.isPreview,host:n.host,locale:n.locale},onHandleDelete:j[3]||(j[3]=ne=>M(ne,I.value)),onHandleCopy:j[4]||(j[4]=ne=>q(ne)),onHandlePaste:ne=>U(ne,I.value,xe),onHandleClick:R},null,8,["type","props-data","onHandlePaste"]))),128))])):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)]),_:1})]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:h.value,"onUpdate:show":j[5]||(j[5]=J=>h.value=J),onHandleEdit:j[6]||(j[6]=J=>f.value=!0),onHandleDelete:M,onHandleCopy:q,onHandlePaste:U,style:{top:"-22px"}},null,8,["show"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(uY,{key:1,show:f.value,"onUpdate:show":j[7]||(j[7]=J=>f.value=J),data:n.modelValue},null,8,["show","data"]))],38))}},[["__scopeId","data-v-cfaecc08"]]),_Y=Object.freeze(Object.defineProperty({__proto__:null,default:Ec},Symbol.toStringTag,{value:"Module"})),wY={class:"tab-logo__btn__img flex-center"},bY=["src","alt"],CY=ee({__name:"TabLogo",props:{tabList:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0},isFixed:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1}},emits:["updateCurrentIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:l,$vsScreenDestroyListener:s}=o,r=n,c=t,u=e.ref(0),g=e.ref(.5*a.value),m=e.ref(0),d=e.ref(!0),p=e.ref(!0),f=e.ref(0),h=e.ref(!1),V=e.ref(0),w=e.ref(0),k=e.ref(0),y=e.ref(null),b=e.ref(null),C=e.ref([]),E=H=>H||"",x=e.computed(()=>u.value-g.value),N=e.computed(()=>[{"--strip-width":`${x.value}px`},{"--strip-left":`${g.value}px`},{"--fix-left":`${m.value}px`},{transition:p.value?"left 0.2s ease-in-out, width 0.2s ease-in-out":""}]),$=e.computed(()=>V.value>0),S=e.computed(()=>w.value-V.value+I.value>k.value),I=e.computed(()=>{if(!h.value)return 24;const H=y.value;if(!H)return 24;const j=window.getComputedStyle(H,null).getPropertyValue("padding-right").split("px")[0];return Number(j)*2}),D=e.computed(()=>!1);e.watch(a,()=>{X(),G()}),e.watch(()=>r.currentIdx,(H,j)=>{d.value=H>j,e.nextTick(()=>A()),e.nextTick(()=>U())}),e.watch(()=>r.isFixed,()=>{a.value>1200&&X(),e.nextTick(()=>G())}),e.watch(()=>r.tabList,(H,j)=>{G(),e.nextTick(()=>{A(0)})},{deep:!0});const A=H=>{const j=H??250;d.value?(O(),setTimeout(Q,j)):(Q(),setTimeout(O,j)),setTimeout(()=>{p.value=!0},j)},O=()=>{const H=C.value[r.currentIdx];H&&H.getBoundingClientRect&&(u.value=H.getBoundingClientRect().right)},Q=()=>{const H=C.value[r.currentIdx];H&&H.getBoundingClientRect&&(g.value=H.getBoundingClientRect().left)},X=()=>{p.value=!1,e.nextTick(()=>A(0)),e.nextTick(()=>M())},G=()=>{const H=y.value;if(H){let j=H.getBoundingClientRect().left;m.value=(H.offsetWidth-H.getBoundingClientRect().width)/2-j}},M=()=>{var H;(H=r.tabList)!=null&&H.length&&(b.value&&(V.value=b.value.scrollLeft,w.value=b.value.scrollWidth),y.value&&(k.value=y.value.getBoundingClientRect().width))},q=H=>{b.value&&(H=="next"?b.value.scrollLeft+=9999:b.value.scrollLeft-=9999)},U=()=>{const H=C.value[r.currentIdx];if(!H)return;const j=H.clientWidth/2,J=a.value/2;f.value=H.getBoundingClientRect().right-j,b.value&&(b.value.scrollLeft-=J-f.value)},R=H=>{c("updateCurrentIdx",H)};return e.onMounted(()=>{h.value=!0,e.nextTick(()=>{A(0),setTimeout(X,300),G(),e.nextTick(()=>{setTimeout(U,300)})})}),(H,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-logo",[{"is-fixed":n.isFixed},{"is-campus":!D.value},{"is-full-width":n.fullWidth}]]),ref_key:"wrapper",ref:y},[e.createElementVNode("ul",{class:"tab-logo__list",ref_key:"list",ref:b,onScroll:X},[e.withDirectives(e.createElementVNode("div",{class:"tab-logo__nav__prev",onClick:j[0]||(j[0]=J=>q("prev"))},null,512),[[e.vShow,$.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabList,(J,fe)=>(e.openBlock(),e.createElementBlock("li",{key:fe,class:e.normalizeClass(["tab-logo__item",[{"tab-logo__item--img":!!J.img}]])},[e.createElementVNode("div",{ref_for:!0,ref_key:"btn",ref:C,class:"flex-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(J.link?"nuxt-link":"button"),{type:J.link?null:"button",to:E(J.link),class:e.normalizeClass(["tab-logo__btn",[{"is-active":n.currentIdx==fe}]]),onClick:xe=>R(fe)},{default:e.withCtx(()=>[e.createElementVNode("div",wY,[e.createElementVNode("img",{src:J.img,alt:J.alt},null,8,bY)])]),_:2},1032,["type","to","class","onClick"]))],512)],2))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-logo__nav__next",onClick:j[1]||(j[1]=J=>q("next"))},null,512),[[e.vShow,S.value]])],544),e.createElementVNode("span",{class:"tab-logo__strip",style:e.normalizeStyle(N.value)},null,4)],2))}},[["__scopeId","data-v-b6353647"]]),VY={class:"setting-content"},xY={class:"setting-header flex items-center"},kY={class:"setting-body"},EY={class:"setting-toolbar"},TY={class:"tools"},NY={class:"setting-item"},SY={class:"item-header"},BY={class:"btn-group"},PY={key:0,class:"drag-handle"},DY=["src"],$Y={class:"item-uplaod flex items-center"},LY={class:"components-content"},AY=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1}));e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1}));const l=m=>m&&m.length>1,s=n,r=t,c=()=>{r("update:show",!1)},u=m=>{debugger;s.data.data.push({id:F(),key:F(),name:"New Tab",img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:"yew-chung-international-school",componentsDataJson:[]})},g=(m,d)=>{s.data.data=s.data.data.filter(p=>p.id!==m)};return(m,d)=>{const p=e.resolveComponent("a-switch"),f=e.resolveComponent("icon-plus"),h=e.resolveComponent("a-button"),V=e.resolveComponent("icon-drag-arrow"),w=e.resolveComponent("icon-delete"),k=e.resolveComponent("a-input"),y=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(y,{width:"60%",visible:n.show,footer:!1,onCancel:c,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",VY,[e.createElementVNode("div",xY,[d[7]||(d[7]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(p,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":d[0]||(d[0]=b=>n.data.onlyShowPc=b)},null,8,["modelValue"])]),e.createElementVNode("div",kY,[e.createElementVNode("div",EY,[d[10]||(d[10]=e.createElementVNode("h1",null,"List",-1)),e.createElementVNode("div",TY,[e.createVNode(h,{type:"primary",onClick:d[1]||(d[1]=b=>u())},{icon:e.withCtx(()=>[e.createVNode(f)]),default:e.withCtx(()=>[d[8]||(d[8]=e.createTextVNode(" 添加 List ",-1))]),_:1}),e.createVNode(h,{type:"primary",onClick:d[2]||(d[2]=b=>u())},{default:e.withCtx(()=>[...d[9]||(d[9]=[e.createTextVNode("粘贴 Tab",-1)])]),_:1})])]),e.createElementVNode("div",NY,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":d[4]||(d[4]=b=>n.data.data=b),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!l(n.data.data),onStart:d[5]||(d[5]=b=>a.value=!0),onEnd:d[6]||(d[6]=b=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:b})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!l(n.data.data)}]),key:b.id},[e.createElementVNode("div",SY,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(b.name),1),e.createElementVNode("span",null,e.toDisplayString(b.key),1)]),e.createElementVNode("div",BY,[l(n.data.data)?(e.openBlock(),e.createElementBlock("div",PY,[e.createVNode(V,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(w,{class:"btn-delete",onClick:C=>g(b.id)},null,8,["onClick"]),e.createVNode(h,{size:"mini",type:"primary",onClick:d[3]||(d[3]=C=>u())},{default:e.withCtx(()=>[...d[11]||(d[11]=[e.createTextVNode("复制 Tab",-1)])]),_:1})])]),d[12]||(d[12]=e.createElementVNode("p",{class:"item-title"},"Alt",-1)),e.createVNode(k,{modelValue:b.alt,"onUpdate:modelValue":C=>b.alt=C,placeholder:"请输入alt","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),d[13]||(d[13]=e.createElementVNode("p",{class:"item-title"},"Key",-1)),e.createVNode(k,{modelValue:b.key,"onUpdate:modelValue":C=>b.key=C,placeholder:"请输入key","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),d[14]||(d[14]=e.createElementVNode("p",{class:"item-title"},"图片",-1)),e.createElementVNode("img",{class:"item-img",src:b.img},null,8,DY),e.createElementVNode("div",$Y,[e.createVNode(k,{modelValue:b.img,"onUpdate:modelValue":C=>b.img=C,placeholder:"请输入图片链接","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(je,{modelValue:b.img,"onUpdate:modelValue":C=>b.img=C,name:b.key},null,8,["modelValue","onUpdate:modelValue","name"])]),d[15]||(d[15]=e.createElementVNode("p",null,"components",-1)),e.createElementVNode("div",LY,[e.createVNode(Fa,{data:b.componentsDataJson,onUpdate:C=>b.componentsDataJson=C},null,8,["data","onUpdate"])])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-c52189f2"]]),IY={class:"tab-page__content"},vY={key:0},MY={style:{position:"relative"}},OY="",Tc=ee({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:""}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=t,{proxy:a}=e.getCurrentInstance(),{$_vsWidth:i,$_vsScrollY:l,$vsScreenAddListener:s,$vsScreenDestroyListener:r}=a,c=n,u=e.ref(0),g=e.ref(!1),m=e.ref(!0),d=e.ref(null),p=e.ref(null),f=e.ref(!1),h=e.ref(!1),V=q=>{if(!q)return{top:0,left:0};const U=q.getBoundingClientRect(),R=window.pageYOffset||document.documentElement.scrollTop,H=window.pageXOffset||document.documentElement.scrollLeft;return{top:U.top+R,left:U.left+H}},w=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.classes)??null}),k=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.style)??null});e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.type)??"TabPrimary"});const y=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.data)??[]}),b=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.fixed)??!0}),C=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.resetToTop)??!0}),E=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.scrollToTop)??!0}),x=e.computed(()=>{var q;return((q=c.modelValue)==null?void 0:q.fullWidth)??!1});e.computed(()=>0),e.computed(()=>!1);const N=e.computed(()=>y.value.some(q=>q.img)),$=e.computed(()=>{var q;return((q=y.value[u.value])==null?void 0:q.key)??null}),S=e.computed(()=>{var U;if(!((U=c.modelValue)!=null&&U.data)||!Array.isArray(c.modelValue.data))return[];const q=c.modelValue.data[u.value];return q?q.componentsDataJson||[]:[]}),I=()=>{var U;if(c.modelValue&&c.modelValue.data)return;const q={id:((U=c.modelValue)==null?void 0:U.id)||F(),type:"TabLogo",onlyShowPc:!1,containerWidth:"",bgColor:"",classes:"custom-class another-class",style:{},width:"",resetToTop:!1,fullWidth:!0,fixed:!1,scrollToTop:!1,data:[{id:F(),key:F(),img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:"yew-chung-international-school",name:"New Tab1",componentsDataJson:[]},{id:F(),key:F(),img:"https://osswebsite-test.cedim.cn/media-library/shared/24-25%E5%BC%80%E5%AD%A6/640-5.jpg",alt:"yew-chung-international-school",name:"New Tab2",componentsDataJson:[]}]};o("update:modelValue",q),u.value=0},D=()=>{var J,fe;const q=p.value;if(!q)return;const U=q.getBoundingClientRect().top,R=d.value;if(!R)return;const H=R.getBoundingClientRect().top,j=+((fe=(J=window.getComputedStyle(document.body))==null?void 0:J.getPropertyValue("--header-height-calc"))==null?void 0:fe.split("px")[0])||0;if(H>j){g.value=!1;return}U<=j&&(g.value=!0)},A=()=>{if(!E.value)return;let q=0;C.value||(q=V(d.value).top-170),window.scroll({top:q,left:0,behavior:"smooth"})},O=q=>{sessionStorage.setItem(OY,q)},Q=(q,U)=>{debugger;o("handleDelete",q||c.modelValue.id,U)},X=q=>{debugger;o("handleCopy",q||c.modelValue)},G=(q,U,R)=>{debugger;o("handlePaste",q,U,R)},M=q=>{o("handleClick",q)};return e.watch(()=>l.value,()=>{D()}),e.watch(u,()=>{O($.value),m.value&&A(),m.value=!0}),e.watch($,q=>{q||(u.value=0)}),e.onMounted(()=>{I(),e.nextTick(D),setTimeout(()=>{e.nextTick(D)},200),setTimeout(()=>{},1e3)}),(q,U)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tab-page",w.value]),style:e.normalizeStyle(k.value),onMouseover:U[6]||(U[6]=R=>h.value=!0),onMouseout:U[7]||(U[7]=R=>h.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["tab-page__hold",[{"is-fixed":g.value&&b.value},{"is-thick":N.value}]]),ref_key:"hold",ref:d},[e.createElementVNode("div",{class:"tab-page__nav",ref_key:"tab",ref:p},[e.createVNode(CY,{tabList:y.value,currentIdx:u.value,isFixed:g.value&&b.value,fullWidth:x.value,onUpdateCurrentIdx:U[0]||(U[0]=R=>u.value=R)},null,8,["tabList","currentIdx","isFixed","fullWidth"])],512)],2),e.createElementVNode("div",IY,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[$.value?(e.openBlock(),e.createElementBlock("div",{key:$.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,R=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[$.value==R.key?(e.openBlock(),e.createElementBlock("div",vY,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.componentsDataJson,(H,j)=>(e.openBlock(),e.createElementBlock("div",MY,[(e.openBlock(),e.createBlock(Co,{key:H.id,type:H.type,"props-data":{modelValue:H,isPreview:n.isPreview,host:n.host,locale:n.locale},onHandleDelete:U[1]||(U[1]=J=>Q(J,S.value)),onHandleCopy:U[2]||(U[2]=J=>X(J)),onHandlePaste:J=>G(J,S.value,j),onHandleClick:M},null,8,["type","props-data","onHandlePaste"]))]))),256))])):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)]),_:1})]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:h.value,"onUpdate:show":U[3]||(U[3]=R=>h.value=R),onHandleEdit:U[4]||(U[4]=R=>f.value=!0),onHandleDelete:Q,onHandleCopy:X,onHandlePaste:G,style:{top:"-22px"}},null,8,["show"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(AY,{key:1,show:f.value,"onUpdate:show":U[5]||(U[5]=R=>f.value=R),data:n.modelValue},null,8,["show","data"]))],38))}},[["__scopeId","data-v-d38408e9"]]),UY=Object.freeze(Object.defineProperty({__proto__:null,default:Tc},Symbol.toStringTag,{value:"Module"})),RY={class:"setting-content"},FY={class:"setting-header flex items-center"},HY={class:"setting-header flex items-center"},jY={class:"setting-header flex items-center"},zY={class:"setting-header flex items-center"},qY={class:"setting-header flex items-center"},WY={class:"setting-header flex items-center"},GY={class:"preview-container"},XY=["src"],YY={key:1,class:"no-preview"},KY={class:"setting-body"},QY={class:"setting-item"},ZY={class:"components-content"},JY=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=n,a=e.ref([{id:"preset-1",name:"YCCECE Background 1",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-01.svg",size:"cover",position:"center center"},{id:"preset-2",name:"YCCECE Background 2",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-02.svg",size:"",position:""},{id:"preset-3",name:"YCCECE Background 3",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-03.svg",size:"cover",position:""},{id:"preset-4",name:"YCCECE Background 4",image:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-04.svg",size:"cover",position:""}]),i=e.ref(),l=a.value.find(u=>u.image===o.data.backgroundImage);i.value=l?l.id:"";const s=()=>{const u=a.value.find(g=>g.id===i.value);u&&(o.data.backgroundImage=`${u.image}`,o.data.backgroundSize=u.size,o.data.backgroundPosition=u.position)},r=t,c=()=>{r("update:show",!1)};return(u,g)=>{const m=e.resolveComponent("a-switch"),d=e.resolveComponent("a-option"),p=e.resolveComponent("a-select"),f=e.resolveComponent("a-button"),h=e.resolveComponent("a-input"),V=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(V,{width:"60%",visible:n.show,footer:!1,onCancel:c,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",RY,[e.createElementVNode("div",FY,[g[6]||(g[6]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(m,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":g[0]||(g[0]=w=>n.data.onlyShowPc=w)},null,8,["modelValue"])]),e.createElementVNode("div",HY,[g[8]||(g[8]=e.createElementVNode("span",{class:"header-title"},"Background Preset",-1)),e.createVNode(p,{modelValue:i.value,"onUpdate:modelValue":g[1]||(g[1]=w=>i.value=w),style:{width:"300px","margin-right":"8px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,w=>(e.openBlock(),e.createBlock(d,{value:w.id,key:w.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(f,{type:"primary",onClick:s},{default:e.withCtx(()=>[...g[7]||(g[7]=[e.createTextVNode("Apply",-1)])]),_:1})]),e.createElementVNode("div",jY,[g[9]||(g[9]=e.createElementVNode("span",{class:"header-title"},"Image",-1)),e.createVNode(h,{modelValue:n.data.backgroundImage,"onUpdate:modelValue":g[2]||(g[2]=w=>n.data.backgroundImage=w),disabled:!0,placeholder:"图片路径",style:{width:"300px"}},null,8,["modelValue"])]),e.createElementVNode("div",zY,[g[10]||(g[10]=e.createElementVNode("span",{class:"header-title"},"Size",-1)),e.createVNode(h,{modelValue:n.data.backgroundSize,"onUpdate:modelValue":g[3]||(g[3]=w=>n.data.backgroundSize=w),disabled:!0,placeholder:"尺寸",style:{width:"300px"}},null,8,["modelValue"])]),e.createElementVNode("div",qY,[g[11]||(g[11]=e.createElementVNode("span",{class:"header-title"},"Position",-1)),e.createVNode(h,{modelValue:n.data.backgroundPosition,"onUpdate:modelValue":g[4]||(g[4]=w=>n.data.backgroundPosition=w),disabled:!0,placeholder:"位置",style:{width:"300px"}},null,8,["modelValue"])]),e.createElementVNode("div",WY,[g[13]||(g[13]=e.createElementVNode("span",{class:"header-title"},"Preview",-1)),e.createElementVNode("div",GY,[n.data.backgroundImage?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.data.backgroundImage,style:e.normalizeStyle({"object-fit":n.data.backgroundSize||"cover","background-position":n.data.backgroundPosition||"center center",width:"100%",height:"100px",border:"1px solid #ddd"}),alt:"Background Preview"},null,12,XY)):(e.openBlock(),e.createElementBlock("div",YY,"No preview available")),g[12]||(g[12]=e.createElementVNode("p",{class:"preview-note"}," A light grey background has been applied for previewing and will not be reflected on website. ",-1))])]),e.createElementVNode("div",KY,[g[14]||(g[14]=e.createElementVNode("div",{class:"setting-toolbar"},[e.createElementVNode("h4",null,"组件")],-1)),e.createElementVNode("div",QY,[e.createElementVNode("div",ZY,[e.createVNode(Fa,{data:n.data.data,onUpdate:g[5]||(g[5]=w=>n.data.data=w)},null,8,["data"])])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-f43efd7b"]]),eK={class:"component-wrapper"},Nc=ee({__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:""}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,a=t,i=e.computed(()=>{var C,E;return!((C=o.modelValue)!=null&&C.data)||!Array.isArray(o.modelValue.data)?[]:(E=o.modelValue)==null?void 0:E.data}),l=(C,E)=>{debugger;a("handleDelete",C||o.modelValue.id,E)},s=C=>{debugger;a("handleCopy",C||o.modelValue)},r=(C,E,x)=>{debugger;a("handlePaste",C,E,x)},c=C=>{a("handleClick",C)},u=e.ref(!1),g=e.ref(!1),m=()=>{var E,x;if(o.modelValue&&o.modelValue.data)return;const C={id:((E=o.modelValue)==null?void 0:E.id)||F(),type:"BackgroundWrapper",onlyShowPc:!1,backgroundImage:"https://ywies-tx.cedim.cn/images/material/ycyw-90th-bg-01.svg",backgroundSize:"cover",backgroundPosition:"center center",data:[{id:((x=o.modelValue)==null?void 0:x.id)||F(),type:"CustomText",onlyShowPc:!1,data:{width:1920,backgroundColor:"#ffffff",title:"这是标题",description:"这是描述"}}]};a("update:modelValue",C)},d=e.computed(()=>{var C;return o.isPreview?!((C=o.modelValue)!=null&&C.onlyShowPc)||!Ne():!0}),p=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.classes)??null}),f=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.style)??null}),h=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.width)??null}),V=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.backgroundImage)??""}),w=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.backgroundColor)??"transparent"}),k=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.backgroundSize)??"contain"}),y=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.backgroundPosition)??"center"}),b=e.computed(()=>{var C;return((C=o.modelValue)==null?void 0:C.backgroundRepeat)??"no-repeat"});return m(),(C,E)=>d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["background-wrapper",p.value]),style:e.normalizeStyle(f.value)},[e.createElementVNode("div",{class:e.normalizeClass(h.value),style:{position:"relative"},onMouseover:E[4]||(E[4]=x=>u.value=!0),onMouseout:E[5]||(E[5]=x=>u.value=!1)},[e.createElementVNode("div",{class:"background-wrapper__bg",style:e.normalizeStyle({"background-image":`url('${V.value}')`,"background-color":`${w.value}`,"background-size":`${k.value}`,"background-position":`${y.value}`,"background-repeat":`${b.value}`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(x,N)=>(e.openBlock(),e.createElementBlock("div",{key:x.id,class:"page-item"},[e.createElementVNode("div",eK,[e.createVNode(Co,{type:x.type,"props-data":{modelValue:x,isPreview:n.isPreview,host:n.host,locale:n.locale},onHandleDelete:E[0]||(E[0]=$=>l($,i.value)),onHandleCopy:E[1]||(E[1]=$=>s($)),onHandlePaste:$=>r($,i.value,N),onHandleClick:c},null,8,["type","props-data","onHandlePaste"])])]))),128))],4),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:u.value,"onUpdate:show":E[2]||(E[2]=x=>u.value=x),onHandleEdit:E[3]||(E[3]=x=>g.value=!0),onHandleDelete:l,onHandleCopy:s,onHandlePaste:r},null,8,["show"]))],34),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(JY,{key:0,show:g.value,"onUpdate:show":E[6]||(E[6]=x=>g.value=x),data:n.modelValue},null,8,["show","data"]))],6)):e.createCommentVNode("",!0)}},[["__scopeId","data-v-ded0ec5a"]]),tK=Object.freeze(Object.defineProperty({__proto__:null,default:Nc},Symbol.toStringTag,{value:"Module"}));var oy="Expected a function",ay=NaN,nK="[object Symbol]",oK=/^\s+|\s+$/g,aK=/^[-+]0x[0-9a-f]+$/i,iK=/^0b[01]+$/i,lK=/^0o[0-7]+$/i,sK=parseInt,rK=typeof ca=="object"&&ca&&ca.Object===Object&&ca,dK=typeof self=="object"&&self&&self.Object===Object&&self,cK=rK||dK||Function("return this")(),uK=Object.prototype,mK=uK.toString,pK=Math.max,hK=Math.min,Np=function(){return cK.Date.now()};function fK(n,t,o){var a,i,l,s,r,c,u=0,g=!1,m=!1,d=!0;if(typeof n!="function")throw new TypeError(oy);t=iy(t)||0,Sc(o)&&(g=!!o.leading,m="maxWait"in o,l=m?pK(iy(o.maxWait)||0,t):l,d="trailing"in o?!!o.trailing:d);function p(E){var x=a,N=i;return a=i=void 0,u=E,s=n.apply(N,x),s}function f(E){return u=E,r=setTimeout(w,t),g?p(E):s}function h(E){var x=E-c,N=E-u,$=t-x;return m?hK($,l-N):$}function V(E){var x=E-c,N=E-u;return c===void 0||x>=t||x<0||m&&N>=l}function w(){var E=Np();if(V(E))return k(E);r=setTimeout(w,h(E))}function k(E){return r=void 0,d&&a?p(E):(a=i=void 0,s)}function y(){r!==void 0&&clearTimeout(r),u=0,a=c=i=r=void 0}function b(){return r===void 0?s:k(Np())}function C(){var E=Np(),x=V(E);if(a=arguments,i=this,c=E,x){if(r===void 0)return f(c);if(m)return r=setTimeout(w,t),p(c)}return r===void 0&&(r=setTimeout(w,t)),s}return C.cancel=y,C.flush=b,C}function gK(n,t,o){var a=!0,i=!0;if(typeof n!="function")throw new TypeError(oy);return Sc(o)&&(a="leading"in o?!!o.leading:a,i="trailing"in o?!!o.trailing:i),fK(n,t,{leading:a,maxWait:t,trailing:i})}function Sc(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function yK(n){return!!n&&typeof n=="object"}function _K(n){return typeof n=="symbol"||yK(n)&&mK.call(n)==nK}function iy(n){if(typeof n=="number")return n;if(_K(n))return ay;if(Sc(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Sc(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(oK,"");var o=iK.test(n);return o||lK.test(n)?sK(n.slice(2),o?2:8):aK.test(n)?ay:+n}var wK=gK;const bK=Ua(wK),CK={class:"setting-content"},VK={class:"setting-header flex items-center"},xK={class:"setting-header flex items-center"},kK={class:"setting-header flex items-center"},EK={class:"setting-header flex items-center"},TK={class:"setting-body"},NK={class:"setting-item"},SK={class:"components-content"},BK=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){e.defineAsyncComponent(()=>import("vuedraggable"));const o=t,a=()=>{o("update:show",!1)};return(i,l)=>{const s=e.resolveComponent("a-switch"),r=e.resolveComponent("a-input"),c=e.resolveComponent("a-option"),u=e.resolveComponent("a-select"),g=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(g,{width:"60%",visible:n.show,footer:!1,onCancel:a,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",CK,[e.createElementVNode("div",VK,[l[5]||(l[5]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(s,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":l[0]||(l[0]=m=>n.data.onlyShowPc=m)},null,8,["modelValue"])]),e.createElementVNode("div",xK,[l[6]||(l[6]=e.createElementVNode("span",{class:"header-title"},"标题",-1)),e.createVNode(r,{modelValue:n.data.title,"onUpdate:modelValue":l[1]||(l[1]=m=>n.data.title=m),placeholder:"请输入标题","allow-clear":""},null,8,["modelValue"])]),e.createElementVNode("div",kK,[l[11]||(l[11]=e.createElementVNode("span",{class:"header-title"},"组件宽度",-1)),e.createVNode(u,{modelValue:n.data.width,"onUpdate:modelValue":l[2]||(l[2]=m=>n.data.width=m),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode(c,{value:""},{default:e.withCtx(()=>[...l[7]||(l[7]=[e.createTextVNode("默认",-1)])]),_:1}),e.createVNode(c,{value:"small"},{default:e.withCtx(()=>[...l[8]||(l[8]=[e.createTextVNode("小",-1)])]),_:1}),e.createVNode(c,{value:"middle"},{default:e.withCtx(()=>[...l[9]||(l[9]=[e.createTextVNode("中",-1)])]),_:1}),e.createVNode(c,{value:"max"},{default:e.withCtx(()=>[...l[10]||(l[10]=[e.createTextVNode("大",-1)])]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",EK,[l[14]||(l[14]=e.createElementVNode("span",{class:"header-title"},"Opened by default",-1)),e.createVNode(u,{modelValue:n.data.openFirst,"onUpdate:modelValue":l[3]||(l[3]=m=>n.data.openFirst=m),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode(c,{value:!0},{default:e.withCtx(()=>[...l[12]||(l[12]=[e.createTextVNode("yes",-1)])]),_:1}),e.createVNode(c,{value:!1},{default:e.withCtx(()=>[...l[13]||(l[13]=[e.createTextVNode("No",-1)])]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",TK,[l[15]||(l[15]=e.createElementVNode("div",{class:"setting-toolbar"},[e.createElementVNode("h4",null,"组件")],-1)),e.createElementVNode("div",NK,[e.createElementVNode("div",SK,[e.createVNode(Fa,{data:n.data.data,onUpdate:l[4]||(l[4]=m=>n.data.data=m)},null,8,["data"])])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-97f379ed"]]),PK={class:"collapse-custom__wrapper"},DK=["innerHTML"],$K={class:"collapse-custom__content__wrapper"},LK={class:"component-wrapper"},Bc=ee({__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0},host:{type:String,default:""},locale:{type:String,default:""}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,a=t,i=e.ref(null),l=e.ref(0),s=e.ref(!1),r=e.ref(null),c=e.ref(!1),u=e.ref(!1),g=e.computed(()=>{var E;return((E=o.modelValue)==null?void 0:E.classes)??""}),m=e.computed(()=>{var E;return((E=o.modelValue)==null?void 0:E.style)??""});e.computed(()=>{var E;return(E=o.modelValue)==null?void 0:E.width});const d=e.computed(()=>{var E;return((E=o.modelValue)==null?void 0:E.title)??[]}),p=e.computed(()=>{var E;return((E=o.modelValue)==null?void 0:E.openFirst)??!1}),f=e.computed(()=>{var E,x;return!((E=o.modelValue)!=null&&E.data)||!Array.isArray(o.modelValue.data)?[]:(x=o.modelValue)==null?void 0:x.data}),h=()=>{if(o.modelValue&&o.modelValue.data)return;a("update:modelValue",{id:"CollapseCustom-O9A0oYhI",type:"CollapseCustom",desc:null,onlyShowPc:!1,title:"不一样的学习",openFirst:!1,width:"",data:[{id:"ArticleList-5AsrYlNT",type:"ArticleList",desc:null,width:"",bgColor:null,data:[{type:"Article",id:"ArticleList-1706498201-Vhj7AhhN-article-1706498204-mFwzyDVU",title:"",content:"<p><strong>大学式学习体验</strong></p>\\n\\n<ul>\\n\\t<li>汇聚四大领域特色学科:科技与革新、创业与发展、体育与健康、创意与艺术;提供核心必修课程和选修课程</li>\\n\\t<li>课程体系满足个性化学习,培养学生自主学习能力和合作学习能力</li>\\n</ul>\\n\\n<p><strong>特色职业及升学辅导</strong></p>\\n\\n<ul>\\n\\t<li>高中课程选择指导</li>\\n\\t<li>国内外知名高等院校升学指导</li>\\n\\t<li>未来大学专业报考指导</li>\\n\\t<li>全程个性化大学申请辅导</li>\\n</ul>\\n\\n<p><strong>先人一步的实践机会</strong></p>\\n\\n<ul>\\n\\t<li>邻近科技园区及研发中心,学生能近距离接触先端科技趋势</li>\\n\\t<li>与周边企业和组织建立深度合作关系,为学生提供沉浸式实习机会</li>\\n</ul>\\n",buttonList:[],linkList:[]},{type:"Image",id:"ArticleList-1706498201-Vhj7AhhN-image-1706498205-x1HZ82BS",imgSrc:"https://osswebsite-test.cedim.cn/media-library/ywies-tx/images/upper-secondary/different_1.jpg",caption:"",alt:null,isRound:!1},{type:"Image",id:"ArticleList-1706498201-Vhj7AhhN-image-1709262654-5pk9M140",imgSrc:"https://osswebsite-test.cedim.cn/media-library/ywies-tx/images/upper-secondary/1_optim.jpg",caption:"",alt:null,isRound:!1}]}]})},V=e.computed(()=>{var E;return o.isPreview?!((E=o.modelValue)!=null&&E.onlyShowPc)||!Ne():!0}),w=()=>{const E=i.value;E&&(l.value=E.scrollHeight)},k=(E,x)=>{debugger;a("handleDelete",E||o.modelValue.id,x)},y=E=>{debugger;a("handleCopy",E||o.modelValue)},b=(E,x,N)=>{debugger;a("handlePaste",E,x,N)},C=E=>{a("handleClick",E)};return e.onMounted(()=>{s.value=p.value,e.nextTick(w);const E=bK(()=>{w()},250);r.value=new ResizeObserver(E),r.value.observe(i.value)}),e.onBeforeUnmount(()=>{i.value&&r.value&&r.value.unobserve(i.value)}),h(),(E,x)=>{var N,$;return V.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["collapse-custom",g.value]),style:e.normalizeStyle(m.value),onMouseover:x[6]||(x[6]=S=>c.value=!0),onMouseout:x[7]||(x[7]=S=>c.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(["collapse-custom_container",[(N=n.modelValue)!=null&&N.width?`container-content-${($=n.modelValue)==null?void 0:$.width}`:"container-content"]])},[e.createElementVNode("div",PK,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["collapse-custom__btn",{"--is-collapsed":!s.value}]),onClick:x[0]||(x[0]=S=>s.value=!s.value)},[e.createElementVNode("h4",{class:"collapse-custom__btn__title",innerHTML:d.value},null,8,DK),x[8]||(x[8]=e.createElementVNode("span",{class:"collapse-custom__btn__icon"},null,-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["collapse-custom__content",{"--is-open":s.value}]),ref_key:"content",ref:i,style:e.normalizeStyle({"--scroll-height":`${l.value}px`})},[e.createElementVNode("div",$K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(S,I)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"page-item"},[e.createElementVNode("div",LK,[e.createVNode(Co,{type:S.type,"props-data":{modelValue:S,isPreview:n.isPreview,host:n.host,locale:n.locale},onHandleDelete:x[1]||(x[1]=D=>k(D,f.value)),onHandleCopy:x[2]||(x[2]=D=>y(D)),onHandlePaste:D=>b(D,f.value,I),onHandleClick:C},null,8,["type","props-data","onHandlePaste"])])]))),128))])],6)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:c.value,"onUpdate:show":x[3]||(x[3]=S=>c.value=S),onHandleEdit:x[4]||(x[4]=S=>u.value=!0),onHandleDelete:k,onHandleCopy:y,onHandlePaste:b,style:{top:"-20px"}},null,8,["show"]))],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(BK,{key:0,show:u.value,"onUpdate:show":x[5]||(x[5]=S=>u.value=S),data:n.modelValue},null,8,["show","data"]))],38)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-51f67726"]]),AK=Object.freeze(Object.defineProperty({__proto__:null,default:Bc},Symbol.toStringTag,{value:"Module"})),IK=["onClick"],vK=ee({__name:"VrTourTab",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i=n,l=t,s=e.ref(0),r=e.ref(0),c=e.ref(0),u=e.ref(0),g=e.ref(null),m=e.ref(null),d=e.ref([]),p=e.computed(()=>s.value>40),f=e.computed(()=>c.value+u.value<r.value+40),h=e.computed({get(){return i.currentIdx??0},set(y){l("updateIdx",y)}});e.watch(a,()=>{V()});const V=()=>{var b;if(!((b=i.list)!=null&&b.length))return;m.value&&(s.value=m.value.scrollLeft),g.value&&(c.value=g.value.getBoundingClientRect().left,u.value=g.value.getBoundingClientRect().width);let y=null;d.value.length>0&&(y=Array.isArray(d.value)?d.value[d.value.length-1]:d.value),y&&y.getBoundingClientRect&&(r.value=y.getBoundingClientRect().left)},w=y=>{m.value&&(y==="next"?m.value.scrollLeft+=200:m.value.scrollLeft-=200)},k=()=>{V()};return e.onMounted(()=>{e.nextTick(()=>{k()})}),(y,b)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-tag",ref_key:"VrtourWrapper",ref:g},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"VrtourList",ref:m,onScroll:k},[e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__prev",onClick:b[0]||(b[0]=C=>w("prev"))},null,512),[[e.vShow,p.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(C,E)=>(e.openBlock(),e.createElementBlock("li",{key:E},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":h.value==E}]),ref_for:!0,ref_key:"VrtourBtn",ref:d,onClick:x=>h.value=E},e.toDisplayString(C.name),11,IK)]))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__next",onClick:b[1]||(b[1]=C=>w("next"))},null,512),[[e.vShow,f.value]])],544)],512))}},[["__scopeId","data-v-45823646"]]),MK=["onClick"],ly=ee({__name:"VrTourCat",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),a=n,i=t,l=e.ref(null),s=e.ref(null),r=e.ref(null),c=e.ref(0),u=e.ref(0),g=e.ref(0),m=e.ref(0),d=e.ref(0),p=e.computed(()=>c.value>40),f=e.computed(()=>g.value+m.value<u.value+40),h=e.computed({get(){return a.currentIdx??0},set(b){i("updateIdx",b),e.nextTick(y)}}),V=()=>{var C;if(!((C=a.list)!=null&&C.length))return;s.value&&(c.value=s.value.scrollLeft),l.value&&(g.value=l.value.getBoundingClientRect().left,m.value=l.value.getBoundingClientRect().width);let b=null;r.value&&(b=Array.isArray(r.value)?r.value[r.value.length-1]:r.value),b&&b.getBoundingClientRect&&(u.value=b.getBoundingClientRect().left)},w=b=>{b=="next"?s.value.scrollLeft+=200:s.value.scrollLeft-=200},k=()=>{s.value&&(c.value=s.value.scrollLeft),V()},y=async()=>{if(await e.nextTick(),!r.value||!r.value[h.value])return;const b=r.value[h.value],C=b.clientWidth/2,E=o.$_vsWidth/2;d.value=b.getBoundingClientRect().right-C,s.value.scrollLeft-=E-d.value};return e.watch(()=>o.$_vsWidth,()=>{V()}),e.watch(()=>a.list,()=>{e.nextTick(V),s.value&&s.value.scrollLeft&&(s.value.scrollLeft=0)},{deep:!0}),e.onMounted(()=>{e.nextTick(k)}),(b,C)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-tag",ref_key:"wrapper",ref:l},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"list",ref:s,onScroll:k},[e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__prev",onClick:C[0]||(C[0]=E=>w("prev"))},null,512),[[e.vShow,p.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(E,x)=>(e.openBlock(),e.createElementBlock("li",{key:x,class:"tab-tag__item"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":h.value==x}]),ref_for:!0,ref_key:"btnRef",ref:r,onClick:N=>h.value=x},e.toDisplayString(E.name),11,MK)]))),128)),e.withDirectives(e.createElementVNode("div",{class:"tab-tag__nav__next",onClick:C[1]||(C[1]=E=>w("next"))},null,512),[[e.vShow,f.value]])],544)],512))}},[["__scopeId","data-v-dec01fdd"]]),OK={class:"tab-tag__nav__prev"},UK=["onClick"],RK=["src","alt"],FK={class:"tab-tag__btn__title"},HK={class:"tab-tag__nav__next"},jK=ee({__name:"VrTourChoose",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i=n,l=t,s=e.ref(null),r=e.ref(null),c=e.ref(null),u=e.ref(0),g=e.ref(0),m=e.ref(0),d=e.ref(0),p=e.ref(0),f=e.computed(()=>u.value>0),h=e.computed(()=>g.value-40>d.value),V=e.computed({get(){return i.currentIdx??0},set(C){l("updateIdx",C),e.nextTick(y)}}),w=()=>{var E,x,N,$;if(!((E=i.list)!=null&&E.length))return;u.value=(x=r.value)==null?void 0:x.scrollLeft,m.value=(N=s.value)==null?void 0:N.getBoundingClientRect().left,d.value=($=s.value)==null?void 0:$.getBoundingClientRect().right;let C=null;c.value&&(C=Array.isArray(c.value)?c.value[c.value.length-1]:c.value),g.value=C==null?void 0:C.getBoundingClientRect().right},k=C=>{C==="next"?r.value.scrollLeft+=200:r.value.scrollLeft-=200},y=()=>{const C=c.value[V.value];if(!C)return;const E=C.clientWidth/2,x=a.value/2;p.value=C.getBoundingClientRect().right-E,r.value.scrollLeft-=x-p.value},b=()=>{w()};return e.watch(()=>a.value,()=>{w()}),e.watch(()=>i.list,()=>{e.nextTick(w),r.value&&r.value.scrollLeft&&(r.value.scrollLeft=0)}),e.onMounted(()=>{e.nextTick(b)}),(C,E)=>(e.openBlock(),e.createElementBlock("div",{class:"vr-tour-choose tab-tag",ref_key:"wrapper",ref:s},[e.createElementVNode("ul",{class:"tab-tag__list",ref_key:"list",ref:r,onScroll:b},[e.withDirectives(e.createElementVNode("div",OK,[e.createElementVNode("button",{type:"button",class:"nav__btn",onClick:E[0]||(E[0]=x=>k("prev"))})],512),[[e.vShow,f.value]]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(x,N)=>(e.openBlock(),e.createElementBlock("li",{key:N,class:"tab-tag__item"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tab-tag__btn",{"is-active":V.value===N}]),ref_for:!0,ref_key:"btn",ref:c,onClick:$=>V.value=N},[e.createElementVNode("img",{src:x.url,alt:x.name},null,8,RK),e.createElementVNode("div",FK,e.toDisplayString(x.name),1)],10,UK)]))),128)),e.withDirectives(e.createElementVNode("div",HK,[e.createElementVNode("button",{type:"button",class:"nav__btn",onClick:E[1]||(E[1]=x=>k("next"))})],512),[[e.vShow,h.value]])],544)],512))}},[["__scopeId","data-v-8086a4bf"]]),zK={class:"vr-tour-scene"},qK=["src"],WK={key:1,class:"vr-tour-scene__img"},GK=["src","alt"],XK=ee({__name:"VrTourScene",props:{scene:{type:Object,default:()=>({})}},setup(n){const t=n,o=e.computed(()=>{var l;return(l=t.scene)==null?void 0:l.embed}),a=e.computed(()=>{var l;return(l=t.scene)==null?void 0:l.url}),i=e.computed(()=>{var l;return(l=t.scene)==null?void 0:l.name});return(l,s)=>(e.openBlock(),e.createElementBlock("div",zK,[o.value?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:o.value,frameborder:"0"},null,8,qK)):(e.openBlock(),e.createElementBlock("div",WK,[e.createElementVNode("img",{src:a.value,alt:i.value},null,8,GK)]))]))}},[["__scopeId","data-v-c07507d5"]]),YK={class:"vr-tour-select"},KK={class:"select-btn__focus-name line-clamp-1"},QK={class:"select-list"},ZK=["onClick"],sy=ee({__name:"VrTourSelect",props:{list:{type:Array,default:()=>[]},currentIdx:{type:[String,Number],default:0}},emits:["updateIdx"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a}=o,i={mounted(h,V){h.clickOutsideEvent=w=>{h===w.target||h.contains(w.target)||V.value(w)},document.body.addEventListener("click",h.clickOutsideEvent)},unmounted(h){document.body.removeEventListener("click",h.clickOutsideEvent)}},l=n,s=t,r=e.ref(!1),c=e.ref(-8),u=e.ref(null),g=e.computed({get(){return l.currentIdx??0},set(h){s("updateIdx",h)}}),m=e.computed(()=>{var h;return((h=l.list[g.value])==null?void 0:h.name)||""});e.watch(r,()=>{p()}),e.onMounted(()=>{window.addEventListener("resize",()=>{a.value=window.innerWidth,r.value&&p()})});const d=()=>{r.value=!1},p=()=>{const h=u.value;if(!h)return;const V=ri(h).x+h.clientWidth;V>a.value&&(c.value=c.value-V+a.value-4)},f=h=>{g.value=h,d()};return(h,V)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",YK,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["select-btn",{"is-open":r.value}]),onClick:V[0]||(V[0]=w=>r.value=!r.value)},[e.createElementVNode("div",KK,e.toDisplayString(m.value),1),V[1]||(V[1]=e.createElementVNode("div",{class:"select-btn__arrow"},null,-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["select-block",{"is-open":r.value}]),style:e.normalizeStyle({"--left":`${c.value}px`}),ref_key:"blockRef",ref:u},[e.createElementVNode("ul",QK,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(w,k)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["select-item line-clamp-1",{"is-active":g.value===k}]),key:k,onClick:y=>f(k)},e.toDisplayString(w.name),11,ZK))),128))])],6)])),[[i,d]])}},[["__scopeId","data-v-536804a2"]]),JK={class:"setting-content"},eQ={class:"setting-header flex items-center"},tQ={class:"setting-body"},nQ={class:"setting-toolbar"},oQ={class:"tools"},aQ={class:"setting-item"},iQ={class:"item-header"},lQ={class:"btn-group"},sQ={key:0,class:"drag-handle"},rQ={key:0},dQ={class:"item-header"},cQ={class:"btn-group"},uQ={key:0,class:"drag-handle"},mQ={class:"item-header"},pQ={class:"btn-group"},hQ={key:0,class:"drag-handle"},fQ=["src"],gQ={class:"item-uplaod flex items-center"},yQ={style:{"text-align":"center"}},_Q={style:{"text-align":"center","margin-top":"20px"}},wQ=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.ref(!1),i=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),l=e.computed(()=>({animation:200,group:"gallerys-above",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=e.computed(()=>({animation:200,group:"gallerys-Categories",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),r=p=>p&&p.length>1,c=n,u=t,g=()=>{u("update:show",!1)},m=(p,f)=>{debugger;const h=c.data;p==="Campus"?h.data.push({key:F(),name:"New Campus",categoriesList:[]}):p==="Category"?f.categoriesList.push(JSON.parse(JSON.stringify({key:F(),name:"New Category",facilitiesList:[]}))):p==="facilitiy"?f.facilitiesList.push({key:F(),name:"New facilitiy",url:"",scene:null,embed:""}):h.data.push({id:F(),key:F(),name:"New Tab",link:"/",componentsDataJson:[]})},d=(p,f,h)=>{debugger;if(f==="Campuses")c.data.data=c.data.data.filter(V=>V.key!==p);else if(f==="facilitiy"){const V=h.findIndex(w=>w.key===p);V!==-1&&h.splice(V,1)}else if(f==="categories"){const V=h.findIndex(w=>w.key===p);V!==-1&&h.splice(V,1)}};return(p,f)=>{const h=e.resolveComponent("a-switch"),V=e.resolveComponent("icon-plus"),w=e.resolveComponent("a-button"),k=e.resolveComponent("icon-drag-arrow"),y=e.resolveComponent("icon-delete"),b=e.resolveComponent("a-input"),C=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(C,{width:"60%",visible:n.show,footer:!1,onCancel:g,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",JK,[e.createElementVNode("div",eQ,[f[9]||(f[9]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(h,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":f[0]||(f[0]=E=>n.data.onlyShowPc=E)},null,8,["modelValue"])]),e.createElementVNode("div",tQ,[e.createElementVNode("div",nQ,[f[11]||(f[11]=e.createElementVNode("h1",null,"Campuses",-1)),e.createElementVNode("div",oQ,[e.createVNode(w,{type:"primary",onClick:f[1]||(f[1]=E=>m("Campus"))},{icon:e.withCtx(()=>[e.createVNode(V)]),default:e.withCtx(()=>[f[10]||(f[10]=e.createTextVNode(" 添加 Campus ",-1))]),_:1})])]),e.createElementVNode("div",aQ,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":f[6]||(f[6]=E=>n.data.data=E),"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},i.value,{disabled:!r(n.data.data),onStart:f[7]||(f[7]=E=>a.value=!0),onEnd:f[8]||(f[8]=E=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:E})=>{var x;return[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(n.data.data)}]),key:E.key},[e.createElementVNode("div",iQ,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString(E.name),1)]),e.createElementVNode("div",lQ,[r(n.data.data)?(e.openBlock(),e.createElementBlock("div",sQ,[e.createVNode(k,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(y,{class:"btn-delete",onClick:N=>d(E.key,"Campuses")},null,8,["onClick"])])]),f[19]||(f[19]=e.createElementVNode("p",{class:"item-title"},"Name",-1)),e.createVNode(b,{modelValue:E.name,"onUpdate:modelValue":N=>E.name=N,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),f[20]||(f[20]=e.createElementVNode("p",{class:"item-title"},"Categories",-1)),e.createElementVNode("div",null,[(x=E.categoriesList)!=null&&x.length?(e.openBlock(),e.createElementBlock("div",rQ,[e.createVNode(e.unref(o),e.mergeProps({modelValue:E.categoriesList,"onUpdate:modelValue":N=>E.categoriesList=N,"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},s.value,{disabled:!r(E.categoriesList),onStart:f[4]||(f[4]=N=>a.value=!0),onEnd:f[5]||(f[5]=N=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:N})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(E.categoriesList)}]),key:N.id,style:{border:"1px solid #d9d9d9","border-radius":"8px"}},[e.createElementVNode("div",dQ,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString(N.name),1)]),e.createElementVNode("div",cQ,[r(E.categoriesList)?(e.openBlock(),e.createElementBlock("div",uQ,[e.createVNode(k,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(y,{class:"btn-delete",onClick:$=>d(N.key,"categories",E.categoriesList)},null,8,["onClick"])])]),f[16]||(f[16]=e.createElementVNode("p",null,"Name",-1)),e.createVNode(b,{modelValue:N.name,"onUpdate:modelValue":$=>N.name=$,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),f[17]||(f[17]=e.createElementVNode("p",{class:"item-title"},"Facilities",-1)),e.createElementVNode("div",null,[e.createVNode(e.unref(o),e.mergeProps({modelValue:N.facilitiesList,"onUpdate:modelValue":$=>N.facilitiesList=$,"component-data":{tag:"div",type:"transition-group",name:a.value?null:"flip-list"}},l.value,{disabled:!r(N.facilitiesList),onStart:f[2]||(f[2]=$=>a.value=!0),onEnd:f[3]||(f[3]=$=>a.value=!1),"item-key":"id"}),{item:e.withCtx(({element:$})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!r(N.facilitiesList)}]),key:$.key,style:{border:"1px solid #d9d9d9","border-radius":"8px"}},[e.createElementVNode("div",mQ,[e.createElementVNode("div",null,[e.createElementVNode("h4",null,e.toDisplayString($.name),1)]),e.createElementVNode("div",pQ,[r(N.facilitiesList)?(e.openBlock(),e.createElementBlock("div",hQ,[e.createVNode(k,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(y,{class:"btn-delete",onClick:S=>d($.key,"facilitiy",N.facilitiesList)},null,8,["onClick"])])]),f[12]||(f[12]=e.createElementVNode("p",{class:"item-title"},"Name",-1)),e.createVNode(b,{modelValue:$.name,"onUpdate:modelValue":S=>$.name=S,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),f[13]||(f[13]=e.createElementVNode("p",{class:"item-title"},"图片",-1)),e.createElementVNode("img",{class:"item-img",src:$.url},null,8,fQ),e.createElementVNode("div",gQ,[e.createVNode(b,{modelValue:$.url,"onUpdate:modelValue":S=>$.url=S,placeholder:"请输入图片链接","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(je,{modelValue:$.url,"onUpdate:modelValue":S=>$.url=S,name:$.key},null,8,["modelValue","onUpdate:modelValue","name"])]),f[14]||(f[14]=e.createElementVNode("p",{class:"item-title"},"VR Embed URL",-1)),e.createVNode(b,{modelValue:$.embed,"onUpdate:modelValue":S=>$.embed=S,placeholder:"请输入","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"])],2))]),_:2},1040,["modelValue","onUpdate:modelValue","component-data","disabled"])]),e.createElementVNode("div",yQ,[e.createVNode(w,{type:"primary",onClick:$=>m("facilitiy",N)},{default:e.withCtx(()=>[...f[15]||(f[15]=[e.createTextVNode("添加Facilities",-1)])]),_:1},8,["onClick"])])],2))]),_:2},1040,["modelValue","onUpdate:modelValue","component-data","disabled"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",_Q,[e.createVNode(w,{type:"primary",onClick:N=>m("Category",E)},{default:e.withCtx(()=>[...f[18]||(f[18]=[e.createTextVNode("添加Category ",-1)])]),_:1},8,["onClick"])])],2))]}),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-73361da3"]]),bQ={class:"vr-tour__wrapper"},CQ={key:0,class:"vr-tour__tabs"},VQ={class:"container-content-middle"},xQ={key:1,class:"vr-tour__selects"},kQ={class:"container-content"},EQ={class:"vr-tour__selects__list"},TQ={class:"vr-tour__scene"},NQ={key:2,class:"vr-tour__cats"},SQ={class:"pt-2"},BQ={key:3,class:"vr-tour__chooses"},Pc=ee({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:l,$vsScreenDestroyListener:s}=o,r=t,c=n,u=e.ref(0),g=e.ref(0),m=e.ref(0),d=e.ref(!1),p=e.ref(!1),f=e.computed(()=>{var b;const y=(b=c.modelValue)==null?void 0:b.data;return Array.isArray(y)?y:[]}),h=e.computed(()=>{var b;const y=(b=f.value[u.value])==null?void 0:b.categoriesList;return Array.isArray(y)?y:[]}),V=e.computed(()=>{var b;const y=(b=h.value[g.value])==null?void 0:b.facilitiesList;return Array.isArray(y)?y:[]}),w=e.computed(()=>{var y;return(y=V.value)==null?void 0:y[m.value]}),k=()=>{var b;if(c.modelValue&&c.modelValue.data)return;const y={id:((b=c.modelValue)==null?void 0:b.id)||F(),type:"VrTour",onlyShowPc:!1,containerWidth:"",bgColor:"",classes:"custom-class another-class",style:{},width:"",data:[{key:F(),name:"SecondarySchool",categoriesList:[{key:F(),name:"Facilities",facilitiesList:[{key:F(),name:"ECE Learning Communities",url:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt/multi_floor_plans/853_floorplan.png",scene:null,embed:"https://osswebsite.ycyw.com/ycis-qd/res/qd/vt-2026/en/index.html"}]}]}]};r("update:modelValue",y),u.value=0};return e.watch(u,()=>{g.value=0}),e.watch(g,()=>{m.value=0}),k(),(y,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vr-tour bg-neutral-lightest",{"pb-0":V.value&&V.value.length<=1}]),onMouseover:b[9]||(b[9]=C=>p.value=!0),onMouseout:b[10]||(b[10]=C=>p.value=!1)},[e.createElementVNode("div",bQ,[f.value&&f.value.length>1&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",CQ,[e.createElementVNode("div",VQ,[e.createVNode(vK,{list:f.value,onUpdateIdx:b[0]||(b[0]=C=>u.value=C),currentIdx:u.value},null,8,["list","currentIdx"])])])):e.createCommentVNode("",!0),e.unref(a)<768?(e.openBlock(),e.createElementBlock("div",xQ,[e.createElementVNode("div",kQ,[e.createElementVNode("div",EQ,[f.value.length>1?(e.openBlock(),e.createBlock(sy,{key:0,list:f.value,onUpdateIdx:b[1]||(b[1]=C=>u.value=C),currentIdx:u.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0),h.value.length>1?(e.openBlock(),e.createBlock(sy,{key:1,list:h.value,onUpdateIdx:b[2]||(b[2]=C=>g.value=C),currentIdx:g.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0)])]),V.value.length>1?(e.openBlock(),e.createBlock(ly,{key:0,list:V.value,onUpdateIdx:b[3]||(b[3]=C=>m.value=C),currentIdx:m.value},null,8,["list","currentIdx"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",TQ,[e.createVNode(XK,{scene:w.value},null,8,["scene"])]),h.value&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",NQ,[e.withDirectives(e.createElementVNode("div",SQ,null,512),[[e.vShow,h.value.length<=1&&V.value&&V.value.length>1]]),e.withDirectives(e.createVNode(ly,{list:h.value,onUpdateIdx:b[4]||(b[4]=C=>g.value=C),currentIdx:g.value},null,8,["list","currentIdx"]),[[e.vShow,h.value.length>1]])])):e.createCommentVNode("",!0),V.value&&V.value.length>1&&e.unref(a)>=768?(e.openBlock(),e.createElementBlock("div",BQ,[e.createVNode(jK,{list:V.value,onUpdateIdx:b[5]||(b[5]=C=>m.value=C),currentIdx:m.value},null,8,["list","currentIdx"])])):e.createCommentVNode("",!0)]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:p.value,"onUpdate:show":b[6]||(b[6]=C=>p.value=C),onHandleEdit:b[7]||(b[7]=C=>d.value=!0),onHandleDelete:y.handleDelete,onHandleCopy:y.handleCopy,onHandlePaste:y.handlePaste},null,8,["show","onHandleDelete","onHandleCopy","onHandlePaste"])),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(wQ,{key:1,show:d.value,"onUpdate:show":b[8]||(b[8]=C=>d.value=C),data:n.modelValue},null,8,["show","data"]))],34))}},[["__scopeId","data-v-48f56fcd"]]),PQ=Object.freeze(Object.defineProperty({__proto__:null,default:Pc},Symbol.toStringTag,{value:"Module"})),DQ={class:"seting-box"},$Q={class:"setting-header flex items-center"},LQ={key:0},AQ={class:"setting-header items-center"},IQ={class:"draggable_box"},vQ={class:"drag_top_box"},MQ=["onClick"],OQ={key:0},UQ={class:"draggable_link_box"},RQ={class:"drag_link_top_box"},FQ=["onClick"],HQ=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.computed(()=>({animation:200,group:"gridLinks",disabled:!1,ghostClass:"ghost",handle:".drag-handle, .icon_drag",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),i=e.computed(()=>({animation:200,group:"gridLinkItems",disabled:!1,ghostClass:"ghost",handle:".drag-handle, .icon_drag",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),l=e.ref(!1),s=e.ref(!1),r=n,c=e.ref(new Set),u=e.ref(new Set),g=()=>{var E,x;(x=(E=r.data)==null?void 0:E.data)!=null&&x.list&&Array.isArray(r.data.data.list)&&(c.value.clear(),u.value.clear(),r.data.data.list.forEach(N=>{N.id&&c.value.add(N.id),N.links&&Array.isArray(N.links)&&N.links.length>0&&N.links.forEach($=>{$.id&&u.value.add($.id)})}))},m=e.ref(!1);e.watch(()=>r.show,E=>{E&&!m.value?(m.value=!0,e.nextTick(()=>{g()})):E||(m.value=!1)},{immediate:!0});const d=E=>{var x,N;c.value.has(E.id)?(c.value.clear(),(N=(x=r.data)==null?void 0:x.data)!=null&&N.list&&r.data.data.list.forEach($=>{$.id!==E.id&&c.value.add($.id)})):c.value.add(E.id)},p=E=>c.value.has(E.id),f=E=>{r.data.data.list=r.data.data.list.filter(x=>x.id!==E)},h=()=>{var N,$;const E=r.data.data,x=F();E.list.push({id:x,title:"这里是标题",links:[]}),c.value.clear(),($=(N=r.data)==null?void 0:N.data)!=null&&$.list&&r.data.data.list.forEach(S=>{S.id!==x&&c.value.add(S.id)}),e.nextTick(()=>{if(typeof document<"u"){const S=document.querySelector(".arco-drawer-body");S&&(S.scrollTop=S.scrollHeight)}})},V=E=>{u.value.has(E.id)?u.value.delete(E.id):u.value.add(E.id)},w=E=>u.value.has(E.id),k=E=>{const x=r.data.data.list.find(N=>N.id===E);if(x){const N=F();x.links.push({id:N,name:"这里是名称",link:""}),x.links&&Array.isArray(x.links)&&x.links.forEach($=>{$.id!==N?u.value.add($.id):u.value.delete($.id)})}},y=(E,x)=>{const N=r.data.data.list.find($=>$.id===E);N&&N.links&&(N.links=N.links.filter($=>$.id!==x))},b=t,C=()=>{b("update:show",!1)};return(E,x)=>{const N=e.resolveComponent("a-switch"),$=e.resolveComponent("a-option"),S=e.resolveComponent("a-select"),I=e.resolveComponent("icon-drag-dot"),D=e.resolveComponent("icon-drag-arrow"),A=e.resolveComponent("icon-delete"),O=e.resolveComponent("a-input"),Q=e.resolveComponent("icon-plus"),X=e.resolveComponent("a-button"),G=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(G,{width:500,visible:n.show,footer:!1,onCancel:C,unmountOnClose:""},{title:e.withCtx(()=>{var M;return[e.createTextVNode(e.toDisplayString((M=n.data)==null?void 0:M.type)+"组件编辑 ",1)]}),default:e.withCtx(()=>[e.createElementVNode("div",DQ,[e.createElementVNode("div",$Q,[x[7]||(x[7]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(N,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":x[0]||(x[0]=M=>n.data.onlyShowPc=M)},null,8,["modelValue"])]),x[19]||(x[19]=e.createElementVNode("p",{class:"item-title"},"组件宽度",-1)),e.createVNode(S,{modelValue:n.data.data.width,"onUpdate:modelValue":x[1]||(x[1]=M=>n.data.data.width=M),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode($,{value:""},{default:e.withCtx(()=>[...x[8]||(x[8]=[e.createTextVNode("默认",-1)])]),_:1}),e.createVNode($,{value:"small"},{default:e.withCtx(()=>[...x[9]||(x[9]=[e.createTextVNode("小",-1)])]),_:1}),e.createVNode($,{value:"middle"},{default:e.withCtx(()=>[...x[10]||(x[10]=[e.createTextVNode("中",-1)])]),_:1}),e.createVNode($,{value:"max"},{default:e.withCtx(()=>[...x[11]||(x[11]=[e.createTextVNode("大",-1)])]),_:1})]),_:1},8,["modelValue"]),x[20]||(x[20]=e.createElementVNode("div",{class:"part_title",style:{"margin-top":"20px"}},"链接列表",-1)),n.data.data.list.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",LQ,"暂无数据")),e.createElementVNode("div",AQ,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data.list,"onUpdate:modelValue":x[4]||(x[4]=M=>n.data.data.list=M),"component-data":{tag:"div",type:"transition-group",name:l.value?null:"flip-list"}},a.value,{disabled:!1,onStart:x[5]||(x[5]=M=>l.value=!0),onEnd:x[6]||(x[6]=M=>l.value=!1),"item-key":"id"}),{item:e.withCtx(({element:M})=>[e.createElementVNode("div",IQ,[e.createElementVNode("div",vQ,[e.createElementVNode("div",{class:"drag-handle",onClick:q=>d(M)},[e.createVNode(I,{style:{"margin-right":"10px"}}),e.createTextVNode(e.toDisplayString(M.title),1)],8,MQ),e.createElementVNode("div",null,[e.createVNode(D,{class:"icon_drag"}),e.createVNode(A,{class:"btn-delete",onClick:e.withModifiers(q=>f(M.id),["stop"])},null,8,["onClick"])])]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[x[16]||(x[16]=e.createElementVNode("p",{class:"item-title",style:{"margin-top":"20px"}},"标题",-1)),e.createVNode(O,{modelValue:M.title,"onUpdate:modelValue":q=>M.title=q,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),x[17]||(x[17]=e.createElementVNode("p",{class:"item-title",style:{"margin-top":"20px"}},"链接",-1)),M.links.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",OQ,"暂无数据")),e.createVNode(e.unref(o),e.mergeProps({modelValue:M.links,"onUpdate:modelValue":q=>M.links=q,"component-data":{tag:"div",type:"transition-group",name:s.value?null:"flip-list"}},i.value,{disabled:!1,onStart:x[2]||(x[2]=q=>s.value=!0),onEnd:x[3]||(x[3]=q=>s.value=!1),"item-key":"id"}),{item:e.withCtx(({element:q})=>[e.createElementVNode("div",UQ,[e.createElementVNode("div",RQ,[e.createElementVNode("div",{class:"drag-handle",onClick:U=>V(q)},[e.createVNode(I,{style:{"margin-right":"10px"}}),x[12]||(x[12]=e.createTextVNode("链接 ",-1))],8,FQ),e.createElementVNode("div",null,[e.createVNode(D,{class:"icon_drag"}),e.createVNode(A,{class:"btn-delete",onClick:e.withModifiers(U=>y(M.id,q.id),["stop"])},null,8,["onClick"])])]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[x[13]||(x[13]=e.createElementVNode("p",{class:"link-title",style:{"margin-top":"20px"}}," 名称 ",-1)),e.createVNode(O,{modelValue:q.name,"onUpdate:modelValue":U=>q.name=U,placeholder:"请输入名称","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),x[14]||(x[14]=e.createElementVNode("p",{class:"link-title",style:{"margin-top":"20px"}}," 链接地址 ",-1)),e.createVNode(O,{modelValue:q.link,"onUpdate:modelValue":U=>q.link=U,placeholder:"请输入链接地址","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"])],512),[[e.vShow,!w(q)]])]),_:2},1024)])]),_:2},1040,["modelValue","onUpdate:modelValue","component-data"]),e.createVNode(X,{style:{"margin-top":"20px"},size:"mini",type:"primary",onClick:q=>k(M.id)},{icon:e.withCtx(()=>[e.createVNode(Q)]),default:e.withCtx(()=>[x[15]||(x[15]=e.createTextVNode(" 链接 ",-1))]),_:1},8,["onClick"])],512),[[e.vShow,!p(M)]])]),_:2},1024)])]),_:1},16,["modelValue","component-data"])]),e.createVNode(X,{type:"primary",onClick:h,style:{"margin-top":"20px"}},{icon:e.withCtx(()=>[e.createVNode(Q)]),default:e.withCtx(()=>[x[18]||(x[18]=e.createTextVNode(" 新增 ",-1))]),_:1})])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-ffec87b5"]]),jQ=["innerHTML"],zQ={key:0,class:"grid-links__sublist"},qQ=["onClick"],WQ={key:1,class:"grid-links__subitem__link"},Sp=ee(e.defineComponent({name:"GridLinks",__name:"index",props:{modelValue:{type:Object,default:()=>{}},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste","handleClick"],setup(n,{emit:t}){const o=n,a=t,i=p=>{a("handleClick",p)},l=e.computed(()=>{var p;return o.isPreview?!((p=o.modelValue)!=null&&p.onlyShowPc)||!Ne():!0}),s=()=>{var f;if(o.modelValue&&o.modelValue.data)return;const p={id:((f=o.modelValue)==null?void 0:f.id)||F(),type:"GridLinks",onlyShowPc:!1,data:{width:"",bgColor:"white",list:[{id:F(),title:"这里是标题",links:[{id:F(),name:"这里是名称",link:""},{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"}]},{id:F(),title:"这里是标题",links:[{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"}]},{id:F(),title:"这里是标题",links:[{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"}]},{id:F(),title:"这里是标题",links:[{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"},{id:F(),name:"这里是名称",link:"https://www.baidu.com"}]}]}};a("update:modelValue",p)},r=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var h,V;const p=(V=(h=o.modelValue)==null?void 0:h.data)==null?void 0:V.width;return!p||p==="default"?"container-content":{small:"container-content-small",middle:"container-content-middle",max:"container-content-max"}[p]||"container-content"}),g=()=>{a("handleDelete",o.modelValue.id)},m=()=>{a("handleCopy",o.modelValue)},d=p=>{a("handlePaste",p)};return s(),(p,f)=>{var h,V;return e.openBlock(),e.createElementBlock(e.Fragment,null,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"gridLinks_wrap",onMouseenter:f[2]||(f[2]=w=>r.value=!0),onMouseleave:f[3]||(f[3]=w=>r.value=!1)},[e.createElementVNode("div",{class:e.normalizeClass(u.value)},[e.createElementVNode("div",{class:"grid-links__row",style:e.normalizeStyle({"--grid-columns-mobile":p.mobileCol,"--grid-columns-desktop":p.desktopCol})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((V=(h=n.modelValue)==null?void 0:h.data)==null?void 0:V.list)||[],(w,k)=>(e.openBlock(),e.createElementBlock("div",{class:"grid-links__item",key:`${(w==null?void 0:w.title)||"item"}-${k}`},[e.createElementVNode("h6",{class:"grid-links__item__title",innerHTML:(w==null?void 0:w.title)||""},null,8,jQ),Array.isArray(w==null?void 0:w.links)&&w.links.length?(e.openBlock(),e.createElementBlock("ul",zQ,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((w==null?void 0:w.links)||[],(y,b)=>(e.openBlock(),e.createElementBlock("li",{key:`${(y==null?void 0:y.name)||"sub"}-${b}`,class:"grid-links__subitem"},[y!=null&&y.link?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:C=>i(y.link),class:"link_text"},[e.createTextVNode(e.toDisplayString(y==null?void 0:y.name)+" ",1),f[5]||(f[5]=e.createElementVNode("span",{class:"link_text__underline"},null,-1))],8,qQ)):(e.openBlock(),e.createElementBlock("div",WQ,e.toDisplayString(y==null?void 0:y.name),1))]))),128))])):e.createCommentVNode("",!0)]))),128))],4)],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:r.value,"onUpdate:show":f[0]||(f[0]=w=>r.value=w),onHandleEdit:f[1]||(f[1]=w=>c.value=!0),onHandleDelete:g,onHandleCopy:m,onHandlePaste:d},null,8,["show"]))],32)):e.createCommentVNode("",!0),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(HQ,{key:1,show:c.value,"onUpdate:show":f[4]||(f[4]=w=>c.value=w),data:n.modelValue},null,8,["show","data"]))],64)}}}),[["__scopeId","data-v-9efa8188"]]),GQ=Object.freeze(Object.defineProperty({__proto__:null,default:Sp},Symbol.toStringTag,{value:"Module"})),XQ={class:"setting-content"},YQ={class:"setting-header flex items-center"},KQ={class:"setting-header flex items-center"},QQ={class:"setting-body"},ZQ={class:"setting-toolbar"},JQ={class:"tools"},eZ={class:"setting-item"},tZ={class:"item-header"},nZ={class:"btn-group"},oZ={key:0,class:"drag-handle"},aZ=ee(e.defineComponent({__name:"setting",props:{show:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["update:show"],setup(n,{emit:t}){const o=e.defineAsyncComponent(()=>import("vuedraggable")),a=e.defineAsyncComponent(()=>Promise.resolve().then(()=>_t)),i=e.ref(!1),l=e.computed(()=>({animation:200,group:"gallerys",disabled:!1,ghostClass:"ghost",handle:".drag-handle",filter:".arco-input, .arco-select, .arco-checkbox",preventOnFilter:!1})),s=d=>d&&d.length>1,r=n,c=t,u=()=>{c("update:show",!1)},g=d=>{r.data.data.push({key:F(),title:"[[TITLE]]",content:""})},m=d=>{r.data.data=r.data.data.filter(p=>p.key!==d)};return(d,p)=>{const f=e.resolveComponent("a-switch"),h=e.resolveComponent("a-option"),V=e.resolveComponent("a-select"),w=e.resolveComponent("icon-plus"),k=e.resolveComponent("a-button"),y=e.resolveComponent("icon-drag-arrow"),b=e.resolveComponent("icon-delete"),C=e.resolveComponent("a-input"),E=e.resolveComponent("a-drawer");return e.openBlock(),e.createBlock(E,{width:"60%",visible:n.show,footer:!1,onCancel:u,unmountOnClose:""},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.data.type)+"组件编辑 ",1)]),default:e.withCtx(()=>[e.createElementVNode("div",XQ,[e.createElementVNode("div",YQ,[p[7]||(p[7]=e.createElementVNode("span",{class:"header-title"},"仅显示PC端",-1)),e.createVNode(f,{modelValue:n.data.onlyShowPc,"onUpdate:modelValue":p[0]||(p[0]=x=>n.data.onlyShowPc=x)},null,8,["modelValue"])]),e.createElementVNode("div",KQ,[p[12]||(p[12]=e.createElementVNode("span",{class:"header-title"},"组件宽度",-1)),e.createVNode(V,{modelValue:n.data.width,"onUpdate:modelValue":p[1]||(p[1]=x=>n.data.width=x),placeholder:"请选择","allow-clear":""},{default:e.withCtx(()=>[e.createVNode(h,{value:""},{default:e.withCtx(()=>[...p[8]||(p[8]=[e.createTextVNode("默认",-1)])]),_:1}),e.createVNode(h,{value:"small"},{default:e.withCtx(()=>[...p[9]||(p[9]=[e.createTextVNode("小",-1)])]),_:1}),e.createVNode(h,{value:"middle"},{default:e.withCtx(()=>[...p[10]||(p[10]=[e.createTextVNode("中",-1)])]),_:1}),e.createVNode(h,{value:"max"},{default:e.withCtx(()=>[...p[11]||(p[11]=[e.createTextVNode("大",-1)])]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",QQ,[e.createElementVNode("div",ZQ,[p[15]||(p[15]=e.createElementVNode("h4",null,"Topics",-1)),e.createElementVNode("div",JQ,[e.createVNode(k,{type:"primary",onClick:p[2]||(p[2]=x=>g())},{icon:e.withCtx(()=>[e.createVNode(w)]),default:e.withCtx(()=>[p[13]||(p[13]=e.createTextVNode(" 添加 Tab ",-1))]),_:1}),e.createVNode(k,{type:"primary",onClick:p[3]||(p[3]=x=>g())},{default:e.withCtx(()=>[...p[14]||(p[14]=[e.createTextVNode("粘贴 Tab",-1)])]),_:1})])]),e.createElementVNode("div",eZ,[e.createVNode(e.unref(o),e.mergeProps({modelValue:n.data.data,"onUpdate:modelValue":p[4]||(p[4]=x=>n.data.data=x),"component-data":{tag:"div",type:"transition-group",name:i.value?null:"flip-list"}},l.value,{disabled:!s(n.data.data),onStart:p[5]||(p[5]=x=>i.value=!0),onEnd:p[6]||(p[6]=x=>i.value=!1),"item-key":"key"}),{item:e.withCtx(({element:x})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item-button draggable-item",{"sortable-disabled":!s(n.data.data)}]),key:x.key},[e.createElementVNode("div",tZ,[e.createElementVNode("div",null,[e.createElementVNode("h5",null,e.toDisplayString(x.title),1)]),e.createElementVNode("div",nZ,[s(n.data.data)?(e.openBlock(),e.createElementBlock("div",oZ,[e.createVNode(y,{class:"drag-icon"})])):e.createCommentVNode("",!0),e.createVNode(b,{class:"btn-delete",onClick:N=>m(x.key)},null,8,["onClick"])])]),p[16]||(p[16]=e.createElementVNode("p",{class:"item-title"},"title",-1)),e.createVNode(C,{modelValue:x.title,"onUpdate:modelValue":N=>x.title=N,placeholder:"请输入标题","allow-clear":""},null,8,["modelValue","onUpdate:modelValue"]),p[17]||(p[17]=e.createElementVNode("p",{class:"item-title"},"Content",-1)),e.createVNode(e.unref(a),{modelValue:x.content,"onUpdate:modelValue":N=>x.content=N,name:`AccordionText_${x.key}`},null,8,["modelValue","onUpdate:modelValue","name"])],2))]),_:1},16,["modelValue","component-data","disabled"])])])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-a711b39a"]]),iZ=["id"],lZ=["id"],sZ=["onClick"],rZ={class:"accordion-button__title"},dZ=["id","aria-expanded","aria-labelledby"],cZ={class:"accordion-body"},uZ=["innerHTML"],mZ={class:"flex-center mt-10"},Dc=ee({__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(n,{emit:t}){const{proxy:o}=e.getCurrentInstance(),{$_vsWidth:a,$_vsScrollY:i,$vsScreenAddListener:l,$vsScreenDestroyListener:s}=o,r=n,c=t,u=()=>{var O;if(r.modelValue&&Array.isArray(r.modelValue.data)&&r.modelValue.data.length){r.modelValue.openFirst&&p.value.size===0&&p.value.add(r.modelValue.data[0].key);return}const A={id:((O=r.modelValue)==null?void 0:O.id)||F(),type:"AccordionText",onlyShowPc:!1,openFirst:!1,width:"",style:{},data:[{key:F(),title:"tab1",content:"这是内容"}]};c("update:modelValue",A)},g=e.ref(Date.now()),m=e.ref(6),d=e.ref(6),p=e.ref(new Set),f=e.ref([]),h=e.ref(!1),V=e.ref(!1),w=e.computed(()=>{var A;return(A=r.modelValue)!=null&&A.hasOwnProperty("classes")?r.modelValue.classes:null}),k=e.computed(()=>{var A;return(A=r.modelValue)!=null&&A.hasOwnProperty("style")?r.modelValue.style:null});e.computed(()=>{var A;return(A=r.modelValue)!=null&&A.hasOwnProperty("width")?r.modelValue.width:null});const y=e.computed(()=>{var O;const A=(O=r.modelValue)==null?void 0:O.data;return Array.isArray(A)?A:[]}),b=e.computed(()=>y.value.slice(0,m.value)),C=A=>{var O;p.value.has(A)?p.value.delete(A):((O=r.modelValue)!=null&&O.allowMultiple||p.value.clear(),p.value.add(A)),setTimeout(()=>{x(document.getElementById(`accordion-${g.value}-${A}`))},350)},E=A=>p.value.has(A),x=A=>{if(a.value>=768)return;const Q=ri(A).y-150;window.scroll({top:Q,left:0,behavior:"smooth"})},N=()=>{a.value>=768?(m.value=6,d.value=6):(m.value=4,d.value=4)},$=(A,O)=>{debugger;c("handleDelete",A||r.modelValue.id,O)},S=A=>{debugger;c("handleCopy",A||r.modelValue)},I=(A,O)=>{debugger;c("handlePaste",A,O)},D=()=>{};return e.watch(y,(A,O)=>{var Q;N(),(Q=r.modelValue)!=null&&Q.openFirst&&A.length>0&&p.value.size===0&&p.value.add(A[0].key)},{deep:!0,immediate:!0}),e.watch(b,()=>{e.nextTick(D)},{immediate:!1}),e.onMounted(()=>{var A;e.nextTick(N),(A=r.modelValue)!=null&&A.openFirst&&y.value.length>0&&p.value.size===0&&p.value.add(y.value[0].key)}),u(),(A,O)=>{var Q,X;return e.openBlock(),e.createElementBlock("div",{onMouseover:O[4]||(O[4]=G=>V.value=!0),onMouseout:O[5]||(O[5]=G=>V.value=!1),class:e.normalizeClass(["accordion-text",w.value]),id:`accordion-parent-${g.value}`,style:e.normalizeStyle(k.value)},[e.createElementVNode("div",{class:e.normalizeClass(["accordion-text__container",[(Q=n.modelValue)!=null&&Q.width?`container-content-${(X=n.modelValue)==null?void 0:X.width}`:"container-content"]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(G,M)=>(e.openBlock(),e.createElementBlock("div",{key:G.key,class:"accordion-item",ref_for:!0,ref_key:"itemRefs",ref:f,"data-aos":"fade-in"},[e.createElementVNode("div",{class:"accordion-header",id:`accordion-${g.value}-${G.key}`},[e.createElementVNode("button",{class:e.normalizeClass(["accordion-button",{collapsed:!E(G.key)}]),type:"button",onClick:q=>C(G.key)},[e.createElementVNode("div",null,[e.createElementVNode("div",rZ,e.toDisplayString(G.title),1)]),O[6]||(O[6]=e.createElementVNode("span",{class:"accordion-button__icon"},null,-1))],10,sZ)],8,lZ),e.createElementVNode("div",{id:`accordion-${g.value}-collapse-${G.key}`,class:e.normalizeClass(["accordion-collapse collapse",{show:E(G.key)}]),"aria-expanded":E(G.key),"aria-labelledby":`accordion-${g.value}-${G.key}`,style:e.normalizeStyle({height:E(G.key)?"auto":"0",overflow:"hidden"})},[e.createElementVNode("div",cZ,[e.createElementVNode("div",{class:"accordion__content",innerHTML:G.content},null,8,uZ)])],14,dZ)]))),128)),e.withDirectives(e.createElementVNode("div",mZ,[e.createElementVNode("button",{type:"button",class:"btn btn__load-more",onClick:O[0]||(O[0]=G=>m.value+=d.value)},[...O[7]||(O[7]=[e.createElementVNode("span",{class:"i i-load-more"},null,-1)])])],512),[[e.vShow,m.value<y.value.length]]),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te,{key:0,show:V.value,"onUpdate:show":O[1]||(O[1]=G=>V.value=G),onHandleEdit:O[2]||(O[2]=G=>h.value=!0),onHandleDelete:$,onHandleCopy:S,onHandlePaste:I,style:{top:"-10px"}},null,8,["show"]))],2),n.isPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(aZ,{key:0,show:h.value,"onUpdate:show":O[3]||(O[3]=G=>h.value=G),data:n.modelValue},null,8,["show","data"]))],46,iZ)}}},[["__scopeId","data-v-401b6b46"]]),pZ=Object.freeze(Object.defineProperty({__proto__:null,default:Dc},Symbol.toStringTag,{value:"Module"})),hZ={install:n=>{n.component("RibbonBlock",Br)}},fZ={install:n=>{n.component("TimelineStory",Pr)}},gZ={install:n=>{n.component("NewsList",Dr)}},yZ={install:n=>{n.component("TheHistoryCarousel",$r)}},_Z={install:n=>{n.component("CardShowcaseProfile",Lr)}},wZ={install:n=>{n.component("ArticleList",fl)}},bZ={install:n=>{n.component("BannerImage",Rs)}},CZ={install:n=>{n.component("BannerPage",Fs)}},VZ={install:n=>{n.component("BtnList",gl)}},xZ={install:n=>{n.component("GalleryDefault",Hs)}},kZ={install:n=>{n.component("GalleryCaptionRound",js)}},EZ={install:n=>{n.component("GalleryTimeline",hr)}},TZ={install:n=>{n.component("GalleryTimelineCol",fr)}},NZ={install:n=>{n.component("Process",gr)}},SZ={install:n=>{n.component("CustomSpace",yr)}},BZ={install:n=>{n.component("GalleryList",br)}},PZ={install:n=>{n.component("HeroSlide",Cr)}},DZ={install:n=>{n.component("LinkList",Vr)}},$Z={install:n=>{n.component("QuoteText",xr)}},LZ={install:n=>{n.component("DonorLinks",kr)}},AZ={install:n=>{n.component("CardCarousel",Er)}},IZ={install:n=>{n.component("CardCarouselMultiRow",Tr)}},vZ={install:n=>{n.component("BannerQuote",Nr)}},MZ={install:n=>{n.component("ArticleItem",Sr)}},OZ={install:n=>{n.component("CountDown",Ar)}},UZ={install:n=>{n.component("CustomIframe",Ir)}},RZ={install:n=>{n.component("BannerImageWithLink",Or)}},FZ={install:n=>{n.component("ContactUsList",vr)}},HZ={install:n=>{n.component("TableTwo",Mr)}},jZ={install:n=>{n.component("ScrollKeyInfo",Ur)}},zZ={install:n=>{n.component("ContactUsInfo",Rr)}},qZ={install:n=>{n.component("Publications",Fr)}},WZ={install:n=>{n.component("MapStatic",Hr)}},GZ={install:n=>{n.component("CardCarouselArticles",Qr)}},XZ={install:n=>{n.component("CarouselLogo",jr)}},YZ={install:n=>{n.component("Resources",zr)}},KZ={install:n=>{n.component("ResourcesTwo",qr)}},QZ={install:n=>{n.component("Disc",Wr)}},ZZ={install:n=>{n.component("BasicCollapse",Gr)}},JZ={install:n=>{n.component("TableCollapse",Xr)}},eJ={install:n=>{n.component("MediaLogo",vl)}},tJ={install:n=>{n.component("RegisterForm",Yr)}},nJ={install:n=>{n.component("GalleryBlock",Kr)}},oJ={install:n=>{n.component("CardCarouselMultiRowArticles",Zr)}},aJ={install:n=>{n.component("AlummiCommunityList",od)}},iJ={install:n=>{n.component("BlessingMessage",ad)}},lJ={install:n=>{n.component("BlessingSlider",id)}},sJ={install:n=>{n.component("CardShowcase",ld)}},rJ={install:n=>{n.component("ExploreLinks",sd)}},dJ={install:n=>{n.component("SchoolLayout",dd)}},cJ={install:n=>{n.component("CardCarouselMultiRowPublications",cd)}},uJ={install:n=>{n.component("CustomText",Jr)}},mJ={install:n=>{n.component("MediaImageFull",ed)}},pJ={install:n=>{n.component("MediaImageStatic",td)}},hJ={install:n=>{n.component("ArticleListPureText",nd)}},fJ={install:n=>{n.component("TabDefault",ud)}},gJ={install:n=>{n.component("TabTimeLine",md)}},yJ={install:n=>{n.component("CardListProgramme",hd)}},_J={install:n=>{n.component("CardListCircle",pd)}},wJ={install:n=>{n.component("CardListSchool",fd)}},bJ={install:n=>{n.component("MediaVideo",xc)}},CJ={install:n=>{n.component("DetailLink",gd)}},VJ={install:n=>{n.component("InformationLink",kc)}},xJ={install:n=>{n.component("TabPage",Ec)}},kJ={install:n=>{n.component("AccordionText",Dc)}},EJ={install:n=>{n.component("TabLogo",Tc)}},TJ={install:n=>{n.component("BackgroundWrapper",Nc)}},NJ={install:n=>{n.component("CollapseCustom",Bc)}},SJ={install:n=>{n.component("VrTour",Pc)}},Bp={default:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"14px",fontFamily:"Inter, sans-serif",borderRadius:"6px",spacing:"16px"},dark:{primaryColor:"#60a5fa",secondaryColor:"#c084fc",fontSize:"14px",fontFamily:"Inter, sans-serif",borderRadius:"6px",spacing:"16px"},compact:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"12px",fontFamily:"Inter, sans-serif",borderRadius:"4px",spacing:"12px"},large:{primaryColor:"#3b82f6",secondaryColor:"#a855f7",fontSize:"16px",fontFamily:"Inter, sans-serif",borderRadius:"8px",spacing:"20px"}},Bn=e.ref(Bp.default),Ao=e.ref(!1);function BJ(){const n=f=>{typeof f=="string"?Bn.value={...Bp[f]}:Bn.value={...f},a()},t=f=>{Bn.value={...Bn.value,...f},a()},o=()=>{Ao.value=!Ao.value,typeof document<"u"&&document.documentElement.classList.toggle("dark",Ao.value)},a=()=>{if(typeof document>"u")return;const f=document.documentElement,h=Bn.value;f.style.setProperty("--theme-primary",h.primaryColor),f.style.setProperty("--theme-secondary",h.secondaryColor),f.style.setProperty("--font-size-default",h.fontSize),f.style.setProperty("--radius-md",h.borderRadius),f.style.setProperty("--spacing-md",h.spacing)},i=f=>e.computed(()=>f==="primary"?Bn.value.primaryColor:Bn.value.secondaryColor),l=()=>e.computed(()=>Bn.value.fontSize),s=()=>e.computed(()=>Bn.value.fontFamily),r=()=>e.computed(()=>Bn.value.borderRadius),c=()=>e.computed(()=>Bn.value.spacing),u=()=>{n("default"),Ao.value=!1,typeof document<"u"&&document.documentElement.classList.remove("dark")},g=()=>JSON.stringify(Bn.value,null,2),m=f=>{try{const h=JSON.parse(f);return n(h),!0}catch(h){return console.error("Invalid theme configuration:",h),!1}},d=()=>{const f=typeof window<"u"&&typeof localStorage<"u",h=f?localStorage.getItem("officialblock-theme"):null,V=f?localStorage.getItem("officialblock-dark-mode"):null;if(h)try{const w=JSON.parse(h);n(w)}catch(w){console.error("Failed to restore theme:",w)}if(V&&(Ao.value=V==="true",typeof document<"u"&&document.documentElement.classList.toggle("dark",Ao.value)),typeof window<"u"&&typeof window.matchMedia=="function"){const w=window.matchMedia("(prefers-color-scheme: dark)"),k=y=>{(!f||!localStorage.getItem("officialblock-dark-mode"))&&(Ao.value=y.matches,typeof document<"u"&&document.documentElement.classList.toggle("dark",Ao.value))};w.addEventListener("change",k)}a()},p=()=>{typeof window<"u"&&typeof localStorage<"u"&&(localStorage.setItem("officialblock-theme",JSON.stringify(Bn.value)),localStorage.setItem("officialblock-dark-mode",Ao.value.toString()))};return{currentTheme:e.computed(()=>Bn.value),isDarkMode:e.computed(()=>Ao.value),themePresets:Bp,setTheme:n,updateTheme:t,toggleDarkMode:o,resetTheme:u,exportTheme:g,importTheme:m,initTheme:d,saveTheme:p,getThemeColor:i,getFontSize:l,getFontFamily:s,getBorderRadius:r,getSpacing:c}}class PJ{static hexToRgb(t){const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return o?{r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)}:null}static rgbToHex(t,o,a){return"#"+((1<<24)+(t<<16)+(o<<8)+a).toString(16).slice(1)}static adjustBrightness(t,o){const a=this.hexToRgb(t);if(!a)return t;const i=l=>{const s=Math.round(l*(1+o/100));return Math.max(0,Math.min(255,s))};return this.rgbToHex(i(a.r),i(a.g),i(a.b))}static generateColorScale(t){const o=[50,100,200,300,400,500,600,700,800,900,950],a={};return o.forEach((i,l)=>{let s;i<=500?s=80-l*16:s=-20-(l-5)*12,a[i.toString()]=this.adjustBrightness(t,s)}),a}static getContrastRatio(t,o){const a=c=>{const u=this.hexToRgb(c);if(!u)return 0;const g=m=>{const d=m/255;return d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4)};return .2126*g(u.r)+.7152*g(u.g)+.0722*g(u.b)},i=a(t),l=a(o),s=Math.max(i,l),r=Math.min(i,l);return(s+.05)/(r+.05)}static isDarkColor(t){const o=this.hexToRgb(t);return o?(o.r*299+o.g*587+o.b*114)/1e3<128:!1}static getBestTextColor(t){return this.isDarkColor(t)?"#ffffff":"#000000"}static mixColors(t,o,a=.5){const i=this.hexToRgb(t),l=this.hexToRgb(o);if(!i||!l)return t;const s=(r,c)=>Math.round(r*(1-a)+c*a);return this.rgbToHex(s(i.r,l.r),s(i.g,l.g),s(i.b,l.b))}}class DJ{static getCurrentBreakpoint(){if(typeof window>"u")return"xl";const t=window.innerWidth;return t<475?"xs":t<640?"sm":t<768?"md":t<1024?"lg":t<1280?"xl":"2xl"}static isMobile(){return typeof window>"u"?!1:window.innerWidth<768}static isTablet(){if(typeof window>"u")return!1;const t=window.innerWidth;return t>=768&&t<1024}static isDesktop(){return typeof window>"u"?!0:window.innerWidth>=1024}static onBreakpointChange(t){if(typeof window>"u")return()=>{};let o=this.getCurrentBreakpoint();const a=()=>{const i=this.getCurrentBreakpoint();i!==o&&(o=i,t(i))};return window.addEventListener("resize",a),()=>{typeof window<"u"&&window.removeEventListener("resize",a)}}}class ry{static animate(t,o,a,i,l=this.easing.easeOutQuad){if(typeof window>"u"||typeof requestAnimationFrame>"u"||typeof performance>"u")return i(o),()=>{};const s=performance.now();let r;const c=u=>{const g=u-s,m=Math.min(g/a,1),d=l(m),p=t+(o-t)*d;i(p),m<1&&(r=requestAnimationFrame(c))};return r=requestAnimationFrame(c),()=>{r&&cancelAnimationFrame(r)}}static scrollTo(t,o,a=300,i=this.easing.easeOutQuad){return new Promise(l=>{if(typeof window>"u"){l();return}const s=t===window,r=s?window.pageYOffset:t.scrollTop;this.animate(r,o,a,c=>{s?window.scrollTo(0,c):t.scrollTop=c},i),setTimeout(l,a)})}}aa(ry,"easing",{linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:-1+(4-2*t)*t,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1});class $J{static setItem(t,o){if(typeof window>"u"||typeof localStorage>"u")return!1;try{return localStorage.setItem(t,JSON.stringify(o)),!0}catch(a){return console.warn("Failed to save to localStorage:",a),!1}}static getItem(t,o){if(typeof window>"u"||typeof localStorage>"u")return o||null;try{const a=localStorage.getItem(t);return a?JSON.parse(a):o||null}catch(a){return console.warn("Failed to read from localStorage:",a),o||null}}static removeItem(t){if(typeof window>"u"||typeof localStorage>"u")return!1;try{return localStorage.removeItem(t),!0}catch(o){return console.warn("Failed to remove from localStorage:",o),!1}}static cleanExpired(){if(typeof window>"u"||typeof localStorage>"u")return;const t=Date.now(),o=[];for(let a=0;a<localStorage.length;a++){const i=localStorage.key(a);if(i&&i.startsWith("officialblock-"))try{const l=JSON.parse(localStorage.getItem(i)||"{}");l.expires&&l.expires<t&&o.push(i)}catch{}}o.forEach(a=>localStorage.removeItem(a))}}if(typeof globalThis<"u"&&!globalThis.FormData){class n{constructor(){aa(this,"data",new Map)}append(o,a,i){this.data.set(o,{value:a,filename:i})}get(o){const a=this.data.get(o);return a?a.value:null}has(o){return this.data.has(o)}delete(o){this.data.delete(o)}entries(){return this.data.entries()}keys(){return this.data.keys()}values(){return this.data.values()}[Symbol.iterator](){return this.data.entries()}}globalThis.FormData=n}const LJ={install:n=>{n.use(Kp),n.config.globalProperties.$device={get isMobile(){return typeof window<"u"?window.innerWidth<768:!1},get isTablet(){return typeof window<"u"?window.innerWidth>=768&&window.innerWidth<1024:!1},get isMobileOrTablet(){return typeof window<"u"?window.innerWidth<1024:!1},get isDesktop(){return typeof window<"u"?window.innerWidth>=1024:!0}},n.component("ArticleList",fl),n.component("BannerImage",Rs),n.component("BannerPage",Fs),n.component("BtnList",gl),n.component("GalleryDefault",Hs),n.component("GalleryCaptionRound",js),n.component("GalleryTimeline",hr),n.component("GalleryTimelineCol",fr),n.component("Process",gr),n.component("CustomSpace",yr),n.component("GalleryList",br),n.component("HeroSlide",Cr),n.component("LinkList",Vr),n.component("QuoteText",xr),n.component("DonorLinks",kr),n.component("CardCarousel",Er),n.component("CardCarouselMultiRow",Tr),n.component("BannerQuote",Nr),n.component("ArticleItem",Sr),n.component("RibbonBlock",Br),n.component("TimelineStory",Pr),n.component("NewsList",Dr),n.component("TheHistoryCarousel",$r),n.component("CardShowcaseProfile",Lr),n.component("CountDown",Ar),n.component("ContactUsList",vr),n.component("CustomIframe",Ir),n.component("TableTwo",Mr),n.component("ScrollKeyInfo",Ur),n.component("BannerImageWithLink",Or),n.component("ContactUsInfo",Rr),n.component("Publications",Fr),n.component("MapStatic",Hr),n.component("CardCarouselArticles",Qr),n.component("CarouselLogo",jr),n.component("Resources",zr),n.component("ResourcesTwo",qr),n.component("Disc",Wr),n.component("BasicCollapse",Gr),n.component("TableCollapse",Xr),n.component("MediaLogo",vl),n.component("RegisterForm",Yr),n.component("GalleryBlock",Kr),n.component("CardCarouselMultiRowArticles",Zr),n.component("AlummiCommunityList",od),n.component("BlessingMessage",ad),n.component("BlessingSlider",id),n.component("CardShowcase",ld),n.component("ExploreLinks",sd),n.component("SchoolLayout",dd),n.component("CardCarouselMultiRowPublications",cd),n.component("CustomText",Jr),n.component("MediaImageFull",ed),n.component("MediaImageStatic",td),n.component("ArticleListPureText",nd),n.component("TabDefault",ud),n.component("CardListProgramme",hd),n.component("CardListCircle",pd),n.component("CardListSchool",fd),n.component("MediaVideo",xc),n.component("DetailLink",gd),n.component("InformationLink",kc),n.component("TabTimeLine",md),n.component("TabPage",Ec),n.component("TabLogo",Tc),n.component("BackgroundWrapper",Nc),n.component("CollapseCustom",Bc),n.component("VrTour",Pc),n.component("AccordionText",Dc),n.component("GridLinks",Sp)}},AJ={class:"rich-text-editor"},_t=Object.freeze(Object.defineProperty({__proto__:null,default:ee(e.defineComponent({__name:"index",props:{name:{default:""},modelValue:{default:""},placeholder:{default:"请输入内容..."},height:{default:"400px"},mode:{default:"default"},disabled:{type:Boolean,default:!1},maxLength:{default:1e4},excludeKeys:{default:()=>[]},includeKeys:{default:()=>[]}},emits:["update:modelValue","change","focus","blur","created","upload-image","upload-video"],setup(n,{expose:t,emit:o}){const a=n,i=o,l=e.shallowRef(),s=e.ref(""),r=e.computed(()=>typeof a.height=="number"?`${a.height}px`:a.height),c=e.inject("handleUpload",()=>{}),u=e.inject("fileUrl",null),g=e.inject("chooseName",null),m=e.ref(""),d=e.ref(null),p=S=>{if(!c){console.warn("Upload: handleUpload function not provided by ancestor");return}if(m.value=S,l.value)try{const D=l.value.selection;D&&(d.value={anchor:{path:[...D.anchor.path],offset:D.anchor.offset},focus:{path:[...D.focus.path],offset:D.focus.offset}})}catch(D){console.warn("保存光标位置失败:",D)}const I=a.name+"_"+S;c(!0,I)};e.watch(()=>a.name,()=>{u.value=null},{deep:!0,immediate:!0}),e.watch(()=>[u==null?void 0:u.value],([S])=>{const I=a.name+"_"+m.value;!S||!g.value||g.value!==I||l.value&&e.nextTick(()=>{var D,A;if(l.value){try{if(l.value.focus(),d.value)try{l.value.select(d.value)}catch(O){console.warn("恢复光标位置失败,使用默认位置:",O)}}catch(O){console.warn("聚焦编辑器失败:",O)}if(m.value==="img"){const Q=`<img src="${S}" alt="图片" style="max-width: 100%;">`;(D=l.value)==null||D.dangerouslyInsertHtml(Q)}else{const Q=`<video src="${S}" controls style="max-width: 100%;"></video>`;(A=l.value)==null||A.dangerouslyInsertHtml(Q)}d.value=null,m.value=""}})},{immediate:!1});function f(S){return class{constructor(){aa(this,"title");aa(this,"tag");aa(this,"iconSvg");this.title="上传图片",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>'}isActive(){return!1}getValue(){return""}isDisabled(){return!1}exec(){e.nextTick(()=>{console.log("点击了自定义上传图片菜单"),S("img")})}}}function h(S){return class{constructor(){aa(this,"title");aa(this,"tag");aa(this,"iconSvg");this.title="上传视频",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>'}getValue(){return""}isActive(){return!1}isDisabled(){return!1}exec(){e.nextTick(()=>{console.log("点击了自定义上传视频菜单"),S("video")})}}}const V={toolbarKeys:["headerSelect","bold","italic","through","underline","color","fontSize","lineHeight","delIndent","indent","divider","insertTable","justifyCenter","justifyJustify","justifyLeft","justifyRight","bulletedList","numberedList","undo","redo","clearStyle","codeBlock"]},w={placeholder:a.placeholder,readOnly:a.disabled,maxLength:a.maxLength,MENU_CONF:{},hoverbarKeys:{text:{menuKeys:["headerSelect","insertLink","bold","italic","underline","through","clearStyle"]}}},k=Math.random().toString(36).substring(2,9),y=`CustomImageMenu_${k}`,b=`CustomVideoMenu_${k}`,C=S=>{l.value=S;try{const I=f(p),D=h(p),A={key:y,factory(){return new I}},O={key:b,factory(){return new D}};qp.Boot.registerMenu(A),qp.Boot.registerMenu(O)}catch(I){console.warn("菜单注册失败:",I)}V.insertKeys={index:0,keys:[y,b]},i("created",S)};e.onBeforeUnmount(()=>{const S=l.value;S!=null&&S.destroy()}),e.watch(()=>a.modelValue,S=>{S!==s.value&&(s.value=S||"")},{immediate:!0});const E=S=>{i("update:modelValue",s.value),i("change",S)},x=()=>{l.value=void 0},N=S=>{i("focus",S)},$=S=>{i("blur",S)};return t({editor:l,getHtml:()=>s.value,getText:()=>{var S;return((S=l.value)==null?void 0:S.getText())||""},isEmpty:()=>{var S;return((S=l.value)==null?void 0:S.isEmpty())||!0},clear:()=>{var S;return(S=l.value)==null?void 0:S.clear()},focus:()=>{var S;return(S=l.value)==null?void 0:S.focus()},blur:()=>{var S;return(S=l.value)==null?void 0:S.blur()},disable:()=>{var S;return(S=l.value)==null?void 0:S.disable()},enable:()=>{var S;return(S=l.value)==null?void 0:S.enable()}}),(S,I)=>(e.openBlock(),e.createElementBlock("div",AJ,[e.createVNode(e.unref(zp.Toolbar),{class:"editor-toolbar",editor:l.value,defaultConfig:V,mode:n.mode},null,8,["editor","mode"]),e.createVNode(e.unref(zp.Editor),{class:"editor-content",style:e.normalizeStyle({height:r.value}),modelValue:s.value,"onUpdate:modelValue":I[0]||(I[0]=D=>s.value=D),defaultConfig:w,mode:n.mode,onOnCreated:C,onOnChange:E,onOnDestroyed:x,onOnFocus:N,onOnBlur:$},null,8,["style","modelValue","mode"])]))}}),[["__scopeId","data-v-55807020"]])},Symbol.toStringTag,{value:"Module"}));ae.AccordionText=Dc,ae.AccordionTextPlugin=kJ,ae.AlummiCommunityList=od,ae.AlummiCommunityListPlugin=aJ,ae.AnimationUtils=ry,ae.ArticleItem=Sr,ae.ArticleItemPlugin=MZ,ae.ArticleList=fl,ae.ArticleListPlugin=wZ,ae.ArticleListPureText=nd,ae.ArticleListPureTextPlugin=hJ,ae.BackgroundWrapper=Nc,ae.BackgroundWrapperPlugin=TJ,ae.BannerImage=Rs,ae.BannerImagePlugin=bZ,ae.BannerImageWithLink=Or,ae.BannerImageWithLinkPlugin=RZ,ae.BannerPage=Fs,ae.BannerPagePlugin=CZ,ae.BannerQuote=Nr,ae.BannerQuotePlugin=vZ,ae.BasicCollapse=Gr,ae.BasicCollapsePlugin=ZZ,ae.BlessingMessage=ad,ae.BlessingMessagePlugin=iJ,ae.BlessingSlider=id,ae.BlessingSliderPlugin=lJ,ae.BtnList=gl,ae.BtnListPlugin=VZ,ae.CardCarousel=Er,ae.CardCarouselArticles=Qr,ae.CardCarouselArticlesPlugin=GZ,ae.CardCarouselMultiRow=Tr,ae.CardCarouselMultiRowArticles=Zr,ae.CardCarouselMultiRowArticlesPlugin=oJ,ae.CardCarouselMultiRowPlugin=IZ,ae.CardCarouselMultiRowPublications=cd,ae.CardCarouselMultiRowPublicationsPlugin=cJ,ae.CardCarouselPlugin=AZ,ae.CardListCircle=pd,ae.CardListCirclePlugin=_J,ae.CardListProgramme=hd,ae.CardListProgrammePlugin=yJ,ae.CardListSchool=fd,ae.CardListSchoolPlugin=wJ,ae.CardShowcase=ld,ae.CardShowcasePlugin=sJ,ae.CardShowcaseProfile=Lr,ae.CardShowcaseProfilePlugin=_Z,ae.CarouselLogo=jr,ae.CarouselLogoPlugin=XZ,ae.CollapseCustom=Bc,ae.CollapseCustomPlugin=NJ,ae.ContactUsInfo=Rr,ae.ContactUsInfoPlugin=zZ,ae.ContactUsList=vr,ae.ContactUsListPlugin=FZ,ae.CountDown=Ar,ae.CountDownPlugin=OZ,ae.CustomIframe=Ir,ae.CustomIframePlugin=UZ,ae.CustomSpace=yr,ae.CustomSpacePlugin=SZ,ae.CustomText=Jr,ae.CustomTextPlugin=uJ,ae.DetailLink=gd,ae.DetailLinkPlugin=CJ,ae.Disc=Wr,ae.DiscPlugin=QZ,ae.DonorLinks=kr,ae.DonorLinksPlugin=LZ,ae.ExploreLinks=sd,ae.ExploreLinksPlugin=rJ,ae.GalleryBlock=Kr,ae.GalleryBlockPlugin=nJ,ae.GalleryCaptionRound=js,ae.GalleryCaptionRoundPlugin=kZ,ae.GalleryDefault=Hs,ae.GalleryDefaultPlugin=xZ,ae.GalleryList=br,ae.GalleryListPlugin=BZ,ae.GalleryTimeline=hr,ae.GalleryTimelineCol=fr,ae.GalleryTimelineColPlugin=TZ,ae.GalleryTimelinePlugin=EZ,ae.GridLinks=Sp,ae.HeroSlide=Cr,ae.HeroSlidePlugin=PZ,ae.InformationLink=kc,ae.InformationLinkPlugin=VJ,ae.LinkList=Vr,ae.LinkListPlugin=DZ,ae.MapStatic=Hr,ae.MapStaticPlugin=WZ,ae.MediaImageFull=ed,ae.MediaImageFullPlugin=mJ,ae.MediaImageStatic=td,ae.MediaImageStaticPlugin=pJ,ae.MediaLogo=vl,ae.MediaLogoPlugin=eJ,ae.MediaVideo=xc,ae.MediaVideoPlugin=bJ,ae.NewsList=Dr,ae.NewsListPlugin=gZ,ae.Process=gr,ae.ProcessPlugin=NZ,ae.Publications=Fr,ae.PublicationsPlugin=qZ,ae.QuoteText=xr,ae.QuoteTextPlugin=$Z,ae.RegisterForm=Yr,ae.RegisterFormPlugin=tJ,ae.Resources=zr,ae.ResourcesPlugin=YZ,ae.ResourcesTwo=qr,ae.ResourcesTwoPlugin=KZ,ae.ResponsiveUtils=DJ,ae.RibbonBlock=Br,ae.RibbonBlockPlugin=hZ,ae.SchoolLayout=dd,ae.SchoolLayoutPlugin=dJ,ae.ScrollKeyInfo=Ur,ae.ScrollKeyInfoPlugin=jZ,ae.StorageUtils=$J,ae.TabDefault=ud,ae.TabDefaultPlugin=fJ,ae.TabLogo=Tc,ae.TabLogoPlugin=EJ,ae.TabPage=Ec,ae.TabPagePlugin=xJ,ae.TabTimeLine=md,ae.TabTimeLinePlugin=gJ,ae.TableCollapse=Xr,ae.TableCollapsePlugin=JZ,ae.TableTwo=Mr,ae.TableTwoPlugin=HZ,ae.TheHistoryCarousel=$r,ae.TheHistoryCarouselPlugin=yZ,ae.ThemeUtils=PJ,ae.TimelineStory=Pr,ae.TimelineStoryPlugin=fZ,ae.VrTour=Pc,ae.VrTourPlugin=SJ,ae.VueScreenPlugin=Kp,ae.default=LJ,ae.useTheme=BJ,ae.useVueScreen=Yy,Object.defineProperties(ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|